Skip to content

Commit

Permalink
pr commens
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Dec 6, 2023
1 parent cc7ed98 commit b4508d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ def run(self) -> DagsterRun:
@deprecated(**_get_deprecation_kwargs("dagster_run"))
@property
def dagster_run(self) -> DagsterRun:
"""DagsterRun: The current pipeline run."""
"""DagsterRun: The current job run."""
return self.op_execution_context.dagster_run

@deprecated(**_get_deprecation_kwargs("run_id"))
Expand Down Expand Up @@ -1529,13 +1529,13 @@ def step_launcher(self) -> Optional[StepLauncher]:
@public
@property
def job_def(self) -> JobDefinition:
"""JobDefinition: The currently executing pipeline."""
"""JobDefinition: The currently executing job."""
return self.op_execution_context.job_def

@public
@property
def job_name(self) -> str:
"""str: The name of the currently executing pipeline."""
"""str: The name of the currently executing job."""
return self.op_execution_context.job_name

@public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,33 +134,33 @@ def test_context(context: AssetExecutionContext):
deprecation_info, expected_deprecation_args
)

for method in dir(op_context):
for attr in dir(op_context):
if (
method in asset_context_not_deprecated
or method[:2] == "__"
or method in op_context_properties
or method in other_ignores
attr in asset_context_not_deprecated
or attr[:2] == "__"
or attr in op_context_properties
or attr in other_ignores
):
continue
if inspect.ismethod(getattr(op_context, method)):
assert method in dir(asset_context)
if inspect.ismethod(getattr(op_context, attr)):
assert attr in dir(asset_context)
try:
deprecation_info = getattr(asset_context, method)._deprecated # noqa: SLF001
deprecation_info = getattr(asset_context, attr)._deprecated # noqa: SLF001
except Exception:
raise Exception(
f"Method {method} on OpExecutionContext does not have an implementation on"
f"Method {attr} on OpExecutionContext does not have an implementation on"
" AssetExecutionContext. All methods on OpExecutionContext must be"
" re-implemented on AssetExecutionContext with appropriate deprecation"
" warnings. See the class implementation of AssetExecutionContext for more"
" details."
)

expected_deprecation_args = _get_deprecation_kwargs(method)
expected_deprecation_args = _get_deprecation_kwargs(attr)
assert_deprecation_messages_as_expected(deprecation_info, expected_deprecation_args)
else:
raise Exception(
f"Method {method} on OpExecutionContext not accounted for in AssetExecutionContext deprecation"
f" test. Ensure that the method {method} exists on AssetExecutionContext, or is explicitly ignored in"
f"Method {attr} on OpExecutionContext not accounted for in AssetExecutionContext deprecation"
f" test. Ensure that the method {attr} exists on AssetExecutionContext, or is explicitly ignored in"
" the test."
)

Expand Down

0 comments on commit b4508d3

Please sign in to comment.