From 3a8e91948532f3fcd5c01f9a07dc87f3714fcaf4 Mon Sep 17 00:00:00 2001 From: JamieDeMaria Date: Mon, 20 Nov 2023 15:28:01 -0500 Subject: [PATCH] run props on init --- .../dagster/_core/execution/context/compute.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/python_modules/dagster/dagster/_core/execution/context/compute.py b/python_modules/dagster/dagster/_core/execution/context/compute.py index 09495efd59d28..5e5312e1179b5 100644 --- a/python_modules/dagster/dagster/_core/execution/context/compute.py +++ b/python_modules/dagster/dagster/_core/execution/context/compute.py @@ -1421,7 +1421,12 @@ def __init__(self, op_execution_context: OpExecutionContext) -> None: op_execution_context, "op_execution_context", OpExecutionContext ) - self._run_props = 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, + ) @staticmethod def get() -> "AssetExecutionContext": @@ -1436,13 +1441,6 @@ 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