diff --git a/python_modules/dagster/dagster/_core/execution/context/compute.py b/python_modules/dagster/dagster/_core/execution/context/compute.py index 1aa41b4b630f1..ce1bef4476fc9 100644 --- a/python_modules/dagster/dagster/_core/execution/context/compute.py +++ b/python_modules/dagster/dagster/_core/execution/context/compute.py @@ -1381,9 +1381,9 @@ def _get_deprecation_kwargs(attr: str): return deprecation_kwargs -class RunInfo( +class RunProperties( NamedTuple( - "_RunInfo", + "_RunProperties", [ ("run_id", PublicAttr[str]), ("dagster_run", PublicAttr[DagsterRun]), @@ -1406,7 +1406,7 @@ def __new__( run_config: Mapping[str, object], retry_number: int, ): - return super(RunInfo, cls).__new__( + return super(RunProperties, cls).__new__( cls, run_id=run_id, dagster_run=dagster_run, @@ -1420,12 +1420,7 @@ def __init__(self, op_execution_context: OpExecutionContext) -> None: self._op_execution_context = check.inst_param( op_execution_context, "op_execution_context", OpExecutionContext ) - self._run_info = RunInfo( - 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": @@ -1439,8 +1434,16 @@ def op_execution_context(self) -> OpExecutionContext: return self._op_execution_context @property - def run_info(self) -> RunInfo: - return self._run_info + 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