Skip to content

Commit 6aac5a7

Browse files
authored
Add log source fallbacks for old clients (#3829)
1 parent c2a18c3 commit 6aac5a7

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class LogsRequest(BaseRequest):
3434
"""Request model for logs."""
3535

3636
uri: str = Field(title="The uri of the logs file")
37-
source: str = Field(title="The source of the logs file")
37+
# TODO: Remove default value when not supporting clients <0.84.0 anymore
38+
source: str = Field(default="", title="The source of the logs file")
3839
artifact_store_id: UUID = Field(
3940
title="The artifact store ID to associate the logs with.",
4041
)

src/zenml/zen_stores/sql_zen_store.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5744,7 +5744,9 @@ def _create_run(
57445744

57455745
log_entry = LogsSchema(
57465746
uri=pipeline_run.logs.uri,
5747-
source=pipeline_run.logs.source,
5747+
# TODO: Remove fallback when not supporting
5748+
# clients <0.84.0 anymore
5749+
source=pipeline_run.logs.source or "client",
57485750
pipeline_run_id=new_run.id,
57495751
artifact_store_id=pipeline_run.logs.artifact_store_id,
57505752
)
@@ -6152,7 +6154,9 @@ def update_run(
61526154
# Create the log entry
61536155
log_entry = LogsSchema(
61546156
uri=log_request.uri,
6155-
source=log_request.source,
6157+
# TODO: Remove fallback when not supporting
6158+
# clients <0.84.0 anymore
6159+
source=log_request.source or "orchestrator",
61566160
pipeline_run_id=existing_run.id,
61576161
artifact_store_id=log_request.artifact_store_id,
61586162
)
@@ -9041,7 +9045,9 @@ def create_run_step(self, step_run: StepRunRequest) -> StepRunResponse:
90419045

90429046
log_entry = LogsSchema(
90439047
uri=step_run.logs.uri,
9044-
source=step_run.logs.source,
9048+
# TODO: Remove fallback when not supporting
9049+
# clients <0.84.0 anymore
9050+
source=step_run.logs.source or "execution",
90459051
step_run_id=step_schema.id,
90469052
artifact_store_id=step_run.logs.artifact_store_id,
90479053
)

0 commit comments

Comments
 (0)