From 9ca694dfd92476ee843a57e772cc4b3a6e4b35ff Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Fri, 13 Dec 2024 11:27:19 +0100 Subject: [PATCH] Fix optional check --- src/zenml/zen_stores/schemas/pipeline_schemas.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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], )