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(),