Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that check specs target the asset(s) they're defined on #16329

Conversation

johannkm
Copy link
Contributor

@johannkm johannkm commented Sep 6, 2023

Catch typos when you're defining asset check specs. Removes the ability to execute a check on a different asset than the one who's Op it shares.

Context: https://elementl-workspace.slack.com/archives/C05KFG9TETB/p1693969799827069

@johannkm
Copy link
Contributor Author

johannkm commented Sep 6, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@johannkm johannkm force-pushed the johann/09-05-draft_check_that_check_specs_target_the_asset_s_they_re_defined_on branch from 944e253 to f3f67d3 Compare September 6, 2023 03:32
def test_multi_asset_with_check():
@multi_asset(
outs={"one": AssetOut("asset1"), "two": AssetOut("asset2")},
check_specs=[AssetCheckSpec("check1", asset="asset1", description="desc")],
check_specs=[
AssetCheckSpec("check1", asset=AssetKey(["asset1", "one"]), description="desc")
Copy link
Contributor Author

@johannkm johannkm Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these multi asset test cases had the checks pointing at a non existent asset, since outs={"one": AssetOut("asset1") actually createsAssetKey(["asset1", "one"]).

I was very surprised that asset1 in AssetOut("asset1") becomes the key prefix, not the key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schrockn more fodder against prefixes

@johannkm johannkm changed the title draft: check that check specs target the asset(s) they're defined on Check that check specs target the asset(s) they're defined on Sep 6, 2023
@johannkm johannkm marked this pull request as ready for review September 6, 2023 03:38
@johannkm johannkm force-pushed the johann/09-05-draft_check_that_check_specs_target_the_asset_s_they_re_defined_on branch from f3f67d3 to 2cbc784 Compare September 6, 2023 03:57
@johannkm johannkm force-pushed the johann/09-05-draft_check_that_check_specs_target_the_asset_s_they_re_defined_on branch from 2cbc784 to fe5b055 Compare September 6, 2023 14:51
@johannkm johannkm merged commit 1777b3f into master Sep 7, 2023
1 of 3 checks passed
@johannkm johannkm deleted the johann/09-05-draft_check_that_check_specs_target_the_asset_s_they_re_defined_on branch September 7, 2023 15:55
zyd14 pushed a commit to zyd14/dagster that referenced this pull request Sep 15, 2023
…r-io#16329)

Catch typos when you're defining asset check specs. Removes the ability
to execute a check on a different asset than the one who's Op it shares.

Context:
https://elementl-workspace.slack.com/archives/C05KFG9TETB/p1693969799827069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants