From c9fbae37a668c27a74ba57fda05de81d00b9e85a Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Fri, 13 Dec 2024 16:00:27 +0100 Subject: [PATCH] Only load orchestrator environment when necessary --- src/zenml/zen_stores/schemas/pipeline_run_schemas.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/zenml/zen_stores/schemas/pipeline_run_schemas.py b/src/zenml/zen_stores/schemas/pipeline_run_schemas.py index f22a55c306..5d195b16cd 100644 --- a/src/zenml/zen_stores/schemas/pipeline_run_schemas.py +++ b/src/zenml/zen_stores/schemas/pipeline_run_schemas.py @@ -288,12 +288,6 @@ def to_model( Raises: RuntimeError: if the model creation fails. """ - orchestrator_environment = ( - json.loads(self.orchestrator_environment) - if self.orchestrator_environment - else {} - ) - if self.deployment is not None: deployment = self.deployment.to_model(include_metadata=True) @@ -374,6 +368,11 @@ def to_model( # in the response -> We need to reset the metadata here step.metadata = None + orchestrator_environment = ( + json.loads(self.orchestrator_environment) + if self.orchestrator_environment + else {} + ) metadata = PipelineRunResponseMetadata( workspace=self.workspace.to_model(), run_metadata=self.fetch_metadata(),