diff --git a/src/zenml/zen_stores/schemas/pipeline_schemas.py b/src/zenml/zen_stores/schemas/pipeline_schemas.py index bad499c042..3719a64b20 100644 --- a/src/zenml/zen_stores/schemas/pipeline_schemas.py +++ b/src/zenml/zen_stores/schemas/pipeline_schemas.py @@ -156,9 +156,11 @@ def to_model( resources = None if include_resources: + latest_run_user = self.runs[-1].user if self.runs else None + resources = PipelineResponseResources( - latest_run_user=self.runs[-1].user.to_model() - if self.runs + latest_run_user=latest_run_user.to_model() + if latest_run_user else None, tags=[t.tag.to_model() for t in self.tags], )