Skip to content

Commit

Permalink
deprecate get_op_execution_context
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Jan 29, 2024
1 parent f8c4fc9 commit d967f43
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ def __instancecheck__(cls, instance) -> bool:
deprecation_warning(
subject="AssetExecutionContext",
additional_warn_text=(
"Starting in version 1.7.0 AssetExecutionContext will no longer be a subclass"
"Starting in version 1.8.0 AssetExecutionContext will no longer be a subclass"
" of OpExecutionContext."
),
breaking_version="1.7.0",
breaking_version="1.8.0",
stacklevel=1,
)
return super().__instancecheck__(instance)
Expand Down Expand Up @@ -1363,6 +1363,7 @@ def _copy_docs_from_op_execution_context(obj):
"dagster_run": "run",
"run_config": "run.run_config",
"run_tags": "run.tags",
"get_op_execution_context": "op_execution_context",
}

ALTERNATE_EXPRESSIONS = {
Expand Down Expand Up @@ -1496,6 +1497,10 @@ def has_tag(self, key: str) -> bool:
def get_tag(self, key: str) -> Optional[str]:
return self.op_execution_context.get_tag(key)

@deprecated(**_get_deprecation_kwargs("get_op_execution_context"))
def get_op_execution_context(self) -> "OpExecutionContext":
return self.op_execution_context

########## pass-through to op context

#### op related
Expand Down Expand Up @@ -1809,9 +1814,6 @@ def typed_event_stream_error_message(self) -> Optional[str]:
def set_requires_typed_event_stream(self, *, error_message: Optional[str] = None) -> None:
self.op_execution_context.set_requires_typed_event_stream(error_message=error_message)

def get_op_execution_context(self) -> "OpExecutionContext":
return self.op_execution_context


@contextmanager
def enter_execution_context(
Expand Down

0 comments on commit d967f43

Please sign in to comment.