Skip to content

Commit

Permalink
fix execution context init for assets context:
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Nov 16, 2023
1 parent 833f30a commit 62b7ad6
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1468,10 +1468,9 @@ def __init__(self, op_execution_context: OpExecutionContext) -> None:
retry_number=self._op_execution_context.retry_number,
)

self._execution_props = ExecutionProperties(
step_description=f"asset {self.assets_def.node_def.name}",
op_execution_context=self._op_execution_context,
)
# start execution_props as None since enter_execution_context builds an AssetExecutionContext
# for all steps (including ops) and ops will fail on self.assets_def call
self._execution_props = None

@staticmethod
def get() -> "AssetExecutionContext":
Expand All @@ -1490,6 +1489,11 @@ def run_properties(self) -> RunProperties:

@property
def execution_properties(self) -> ExecutionProperties:
if self._execution_props is None:
self._execution_props = ExecutionProperties(
step_description=f"asset {self.assets_def.node_def.name}",
op_execution_context=self._op_execution_context,
)
return self._execution_props

######## Deprecated methods
Expand Down

0 comments on commit 62b7ad6

Please sign in to comment.