-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update context typing rules for asset checks #17137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this makes sense
4690d1d
to
4197e0f
Compare
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Deploy preview for dagster-docs ready! Preview available at https://dagster-docs-9zxhljsgo-elementl.vercel.app Direct link to changed pages: |
Deploy preview for dagit-core-storybook ready! ✅ Preview Built with commit 4197e0f. |
4197e0f
to
36a87ba
Compare
python_modules/dagster/dagster_tests/core_tests/execution_tests/test_context.py
Outdated
Show resolved
Hide resolved
|
||
@asset_check(asset=to_check) | ||
def no_annotation(context): | ||
assert isinstance(context, OpExecutionContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johannkm this is the test case that shows an asset check getting an OpExecutionContext by default when it is used in build_asset_with_blocking_check
. Note that if the user instead chose to use this asset check in the "normal" use case (ie not as a blocking check) it would get an AssetExecutionContext
as shown in [1]
|
||
@asset_check(asset=to_check) | ||
def asset_annotation(context: AssetExecutionContext): | ||
assert isinstance(context, AssetExecutionContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[1]
1b4bc77
to
16e9465
Compare
53f24ef
to
1adc591
Compare
Summary & Motivation
Update the type hint rules for
@asset_check
to followHow I Tested These Changes