From a8f971d05c98009414d7ff87c44f71e746ed189e Mon Sep 17 00:00:00 2001 From: JamieDeMaria Date: Wed, 15 Nov 2023 15:12:10 -0500 Subject: [PATCH] move --- .../_core/execution/context/compute.py | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/python_modules/dagster/dagster/_core/execution/context/compute.py b/python_modules/dagster/dagster/_core/execution/context/compute.py index ce1bef4476fc9..5e5312e1179b5 100644 --- a/python_modules/dagster/dagster/_core/execution/context/compute.py +++ b/python_modules/dagster/dagster/_core/execution/context/compute.py @@ -1360,11 +1360,11 @@ def get() -> "OpExecutionContext": ############################### ALTERNATE_METHODS = { - "run_id": "run_info.run_id", - "run": "run_info.dagster_run", - "dagster_run": "run_info.dagster_run", - "run_config": "run_info.run_config", - "retry_number": "run_info.retry_number", + "run_id": "run_properties.run_id", + "run": "run_properties.dagster_run", + "dagster_run": "run_properties.dagster_run", + "run_config": "run_properties.run_config", + "retry_number": "run_properties.retry_number", } @@ -1420,7 +1420,13 @@ def __init__(self, op_execution_context: OpExecutionContext) -> None: self._op_execution_context = check.inst_param( 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": @@ -1435,14 +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