Skip to content

Commit 8ef9ef3

Browse files
Move step durations to body (#3046)
* Move step durations to body * Auto-update of LLM Finetuning template * Auto-update of Starter template * Auto-update of E2E template --------- Co-authored-by: GitHub Actions <[email protected]>
1 parent 3a964b4 commit 8ef9ef3

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

src/zenml/models/v2/core/step_run.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ class StepRunResponseBody(WorkspaceScopedResponseBody):
156156
"""Response body for step runs."""
157157

158158
status: ExecutionStatus = Field(title="The status of the step.")
159+
start_time: Optional[datetime] = Field(
160+
title="The start time of the step run.",
161+
default=None,
162+
)
163+
end_time: Optional[datetime] = Field(
164+
title="The end time of the step run.",
165+
default=None,
166+
)
159167
inputs: Dict[str, "ArtifactVersionResponse"] = Field(
160168
title="The input artifact versions of the step run.",
161169
default={},
@@ -201,16 +209,6 @@ class StepRunResponseMetadata(WorkspaceScopedResponseMetadata):
201209
max_length=TEXT_FIELD_MAX_LENGTH,
202210
)
203211

204-
# Timestamps
205-
start_time: Optional[datetime] = Field(
206-
title="The start time of the step run.",
207-
default=None,
208-
)
209-
end_time: Optional[datetime] = Field(
210-
title="The end time of the step run.",
211-
default=None,
212-
)
213-
214212
# References
215213
logs: Optional["LogsResponse"] = Field(
216214
title="Logs associated with this step run.",
@@ -409,7 +407,7 @@ def start_time(self) -> Optional[datetime]:
409407
Returns:
410408
the value of the property.
411409
"""
412-
return self.get_metadata().start_time
410+
return self.get_body().start_time
413411

414412
@property
415413
def end_time(self) -> Optional[datetime]:
@@ -418,7 +416,7 @@ def end_time(self) -> Optional[datetime]:
418416
Returns:
419417
the value of the property.
420418
"""
421-
return self.get_metadata().end_time
419+
return self.get_body().end_time
422420

423421
@property
424422
def logs(self) -> Optional["LogsResponse"]:

src/zenml/zen_stores/schemas/step_run_schemas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ def to_model(
262262
body = StepRunResponseBody(
263263
user=self.user.to_model() if self.user else None,
264264
status=ExecutionStatus(self.status),
265+
start_time=self.start_time,
266+
end_time=self.end_time,
265267
inputs=input_artifacts,
266268
outputs=output_artifacts,
267269
created=self.created,
@@ -278,8 +280,6 @@ def to_model(
278280
code_hash=self.code_hash,
279281
docstring=self.docstring,
280282
source_code=self.source_code,
281-
start_time=self.start_time,
282-
end_time=self.end_time,
283283
logs=self.logs.to_model() if self.logs else None,
284284
deployment_id=self.deployment_id,
285285
pipeline_run_id=self.pipeline_run_id,

0 commit comments

Comments
 (0)