Skip to content

Commit

Permalink
Remove unneeded fields from create/update models
Browse files Browse the repository at this point in the history
  • Loading branch information
stefannica committed Feb 21, 2025
1 parent 123a51d commit 3e5d964
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 34 deletions.
3 changes: 0 additions & 3 deletions src/zenml/models/v2/core/model_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ class ModelVersionRequest(WorkspaceScopedRequest):
class ModelVersionUpdate(BaseModel):
"""Update model for model versions."""

model: UUID = Field(
description="The ID of the model containing version",
)
stage: Optional[Union[str, ModelStages]] = Field(
description="Target model version stage to be set",
default=None,
Expand Down
5 changes: 0 additions & 5 deletions src/zenml/models/v2/core/pipeline_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ class PipelineRunUpdate(BaseModel):

status: Optional[ExecutionStatus] = None
end_time: Optional[datetime] = None
model_version_id: Optional[UUID] = Field(
title="The ID of the model version that was "
"configured by this pipeline run explicitly.",
default=None,
)
# TODO: we should maybe have a different update model here, the upper
# three attributes should only be for internal use
add_tags: Optional[List[str]] = Field(
Expand Down
9 changes: 0 additions & 9 deletions src/zenml/models/v2/core/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,6 @@ class ScheduleUpdate(BaseUpdate):
"""Update model for schedules."""

name: Optional[str] = None
active: Optional[bool] = None
cron_expression: Optional[str] = None
start_time: Optional[datetime] = None
end_time: Optional[datetime] = None
interval_second: Optional[timedelta] = None
catchup: Optional[bool] = None
run_once_start_time: Optional[datetime] = None
orchestrator_id: Optional[UUID] = None
pipeline_id: Optional[UUID] = None


# ------------------ Response Model ------------------
Expand Down
13 changes: 0 additions & 13 deletions src/zenml/models/v2/core/step_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,6 @@ class StepRunRequest(WorkspaceScopedRequest):
title="Logs associated with this step run.",
default=None,
)
deployment: UUID = Field(
title="The deployment associated with the step run."
)
model_version_id: Optional[UUID] = Field(
title="The ID of the model version that was "
"configured by this step run explicitly.",
default=None,
)

model_config = ConfigDict(protected_namespaces=())

Expand All @@ -171,11 +163,6 @@ class StepRunUpdate(BaseModel):
title="The end time of the step run.",
default=None,
)
model_version_id: Optional[UUID] = Field(
title="The ID of the model version that was "
"configured by this step run explicitly.",
default=None,
)
model_config = ConfigDict(protected_namespaces=())


Expand Down
3 changes: 0 additions & 3 deletions src/zenml/zen_stores/schemas/step_run_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,6 @@ def update(self, step_update: "StepRunUpdate") -> "StepRunSchema":
self.status = value.value
if key == "end_time":
self.end_time = value
if key == "model_version_id":
if value and self.model_version_id is None:
self.model_version_id = value

self.updated = utc_now()

Expand Down
2 changes: 1 addition & 1 deletion src/zenml/zen_stores/sql_zen_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -8474,7 +8474,7 @@ def _set_run_step_parent_step(
reference_schema=StepRunSchema,
reference_id=parent_id,
session=session,
reference_name="parent step run",
reference_name="parent step",
)
assert parent_step_run is not None

Expand Down

0 comments on commit 3e5d964

Please sign in to comment.