From 815d4e36fa77f3808a4315e115b5ad00e877161f Mon Sep 17 00:00:00 2001 From: JamieDeMaria Date: Fri, 17 Nov 2023 10:29:25 -0500 Subject: [PATCH] start run_props as None --- .../dagster/_core/execution/context/compute.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/python_modules/dagster/dagster/_core/execution/context/compute.py b/python_modules/dagster/dagster/_core/execution/context/compute.py index 5e5312e1179b5..09495efd59d28 100644 --- a/python_modules/dagster/dagster/_core/execution/context/compute.py +++ b/python_modules/dagster/dagster/_core/execution/context/compute.py @@ -1421,12 +1421,7 @@ def __init__(self, op_execution_context: OpExecutionContext) -> None: op_execution_context, "op_execution_context", OpExecutionContext ) - self._run_props = RunProperties( - run_id=self._op_execution_context.run_id, - run_config=self._op_execution_context.run_config, - dagster_run=self._op_execution_context.run, - retry_number=self._op_execution_context.retry_number, - ) + self._run_props = None @staticmethod def get() -> "AssetExecutionContext": @@ -1441,6 +1436,13 @@ def op_execution_context(self) -> OpExecutionContext: @property def run_properties(self) -> RunProperties: + if self._run_props is None: + self._run_props = RunProperties( + run_id=self._op_execution_context.run_id, + run_config=self._op_execution_context.run_config, + dagster_run=self._op_execution_context.run, + retry_number=self._op_execution_context.retry_number, + ) return self._run_props ######## Deprecated methods