Skip to content

Commit

Permalink
move
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Nov 15, 2023
1 parent 00a5dad commit a8f971d
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions python_modules/dagster/dagster/_core/execution/context/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}


Expand Down Expand Up @@ -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":
Expand All @@ -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
Expand Down

0 comments on commit a8f971d

Please sign in to comment.