Skip to content

Commit f0ff10f

Browse files
committed
linting changes
1 parent 687e0f9 commit f0ff10f

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/zenml/zen_stores/schemas/pipeline_run_schemas.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -774,23 +774,28 @@ def _check_if_run_in_progress(self) -> bool:
774774
find_all_downstream_steps(failed_step, dag)
775775
)
776776

777+
# Combine failed steps and their downstream steps
778+
steps_to_skip.update(failed_steps)
779+
780+
# Get the statuses of all steps that have run so far
781+
steps_statuses = {
782+
s.name: ExecutionStatus(s.status)
783+
for s in self.step_runs
784+
}
785+
777786
# Check if all non-skipped steps are finished
778787
for step in steps:
779-
# If it is a downstream step of a failed step, skip
788+
# If it is a failed step or a downstream step of a failed step, continue
780789
if step.config.name in steps_to_skip:
781790
continue
782-
783-
# If it is not in the step runs yet
784-
if step.config.name not in [
785-
s.name for s in self.step_runs
786-
]:
791+
# If it is not in the step runs yet, it is in progress
792+
if step.config.name not in steps_statuses:
787793
return True
788-
# Else, check if it is finished
789-
elif not ExecutionStatus(
790-
self.step_runs[step.config.name].status
791-
).is_finished:
794+
# If it is in the step runs and is not finished, it is in progress
795+
elif not steps_statuses[step.config.name].is_finished:
792796
return True
793797

798+
# Otherwise, it is not in progress
794799
return False
795800
else:
796801
# No deployment, fallback to basic check

src/zenml/zen_stores/sql_zen_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5853,7 +5853,7 @@ def get_run_status(self, run_id: UUID) -> ExecutionStatus:
58535853
schema_class=PipelineRunSchema,
58545854
session=session,
58555855
)
5856-
return run.status
5856+
return ExecutionStatus(run.status)
58575857

58585858
def _check_if_run_in_progress(
58595859
self, run_id: UUID

0 commit comments

Comments
 (0)