Skip to content

Commit

Permalink
upate usage of selected_asset_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Sep 26, 2023
1 parent fcabda0 commit fb6cac4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions python_modules/dagster-test/dagster_test/toys/asset_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def random_fail_check_on_partitioned_asset():
can_subset=True,
)
def multi_asset_1_and_2(context):
if AssetKey("multi_asset_piece_1") in context.selected_asset_keys:
if AssetKey("multi_asset_piece_1") in context.asset_keys:
yield Output(1, output_name="one")
yield AssetCheckResult(success=True, metadata={"foo": "bar"})
if AssetKey("multi_asset_piece_2") in context.selected_asset_keys:
if AssetKey("multi_asset_piece_2") in context.asset_keys:
yield Output(1, output_name="two")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ def my_function():
can_subset=True,
)
def subset(context: AssetExecutionContext):
# ...use context.selected_asset_keys materialize subset of assets without IO manager
# ...use context.asset_keys materialize subset of assets without IO manager
pass

with pytest.raises(
Expand Down Expand Up @@ -1882,7 +1882,7 @@ def basic_deps():
can_subset=True,
)
def basic_subset(context: AssetExecutionContext):
for key in context.selected_asset_keys:
for key in context.asset_keys:
yield MaterializeResult(asset_key=key)

mats = _exec_asset(basic_subset, ["table_A"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2738,10 +2738,10 @@ def test_subset_cycle_resolution_basic():
can_subset=True,
)
def foo(context, s, a_prime):
context.log.info(context.selected_asset_keys)
if AssetKey("a") in context.selected_asset_keys:
context.log.info(context.asset_keys)
if AssetKey("a") in context.asset_keys:
yield Output(s + 1, "a")
if AssetKey("b") in context.selected_asset_keys:
if AssetKey("b") in context.asset_keys:
yield Output(a_prime + 1, "b")

@multi_asset(
Expand All @@ -2753,10 +2753,10 @@ def foo(context, s, a_prime):
can_subset=True,
)
def foo_prime(context, a, b):
context.log.info(context.selected_asset_keys)
if AssetKey("a_prime") in context.selected_asset_keys:
context.log.info(context.asset_keys)
if AssetKey("a_prime") in context.asset_keys:
yield Output(a + 1, "a_prime")
if AssetKey("b_prime") in context.selected_asset_keys:
if AssetKey("b_prime") in context.asset_keys:
yield Output(b + 1, "b_prime")

job = Definitions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,10 @@ def test_multi_asset_with_check_subset():
can_subset=True,
)
def asset_1_and_2(context: AssetExecutionContext):
if AssetKey("asset1") in context.selected_asset_keys:
if AssetKey("asset1") in context.asset_keys:
yield Output(None, output_name="one")
yield AssetCheckResult(check_name="check1", success=True)
if AssetKey("asset2") in context.selected_asset_keys:
if AssetKey("asset2") in context.asset_keys:
yield Output(None, output_name="two")

# no selection
Expand Down

0 comments on commit fb6cac4

Please sign in to comment.