Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Dec 7, 2023
1 parent 4b26c05 commit 41e0231
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
30 changes: 5 additions & 25 deletions python_modules/dagster/dagster/_core/execution/context/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,38 +1399,18 @@ def _get_deprecation_kwargs(attr: str):
return deprecation_kwargs


class RunProperties(
NamedTuple(
"_RunProperties",
[
("run_id", PublicAttr[str]),
("dagster_run", PublicAttr[DagsterRun]),
("run_config", PublicAttr[Mapping[str, object]]),
("retry_number", PublicAttr[int]),
],
)
):
class RunProperties(NamedTuple):
"""Relevant information about a run while it is executing. Contains:
* The run ID
* The DagsterRun object, which contains further information about the run
* The run config
* The retry number - how many times this step has been retried.
"""

def __new__(
cls,
run_id: str,
dagster_run: DagsterRun,
run_config: Mapping[str, object],
retry_number: int,
):
return super(RunProperties, cls).__new__(
cls,
run_id=run_id,
dagster_run=dagster_run,
run_config=run_config,
retry_number=retry_number,
)
run_id: PublicAttr[str]
dagster_run: PublicAttr[DagsterRun]
run_config: PublicAttr[Mapping[str, object]]
retry_number: PublicAttr[int]


class AssetExecutionContext(OpExecutionContext):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def assert_deprecation_messages_as_expected(received_info, expected_info):
assert received_info.subject == expected_info["subject"]

for attr in dir(OpExecutionContext):
if attr[:2] == "__" or attr in other_ignores:
if attr.startswith("__") or attr in other_ignores:
continue
if not hasattr(AssetExecutionContext, attr):
raise Exception(
Expand Down

0 comments on commit 41e0231

Please sign in to comment.