-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[module-loaders] Further simplify asset checks path #26527
[module-loaders] Further simplify asset checks path #26527
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b37696c
to
1c711a7
Compare
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 thought about this a bit more, and as much as it really is unlikely that this causes issues, it is part of our public api and we should do our best to respect semver. These bits of code are ugly but not necessarily an ongoing maintenance concern
"AssetChecksDefinition is a thin wrapper around AssetsDefinition" predates this PR, but i actually think exposing this implementation is a little risky as many users may not think asset check is a thin wrapper around asset definition (if you look at our doc today, asset_check feels like a peer concept to asset than a extending implementation. with that, i'm with owen that while this isn't a significant change, it could be a thrash to existing users. for example, a concrete confusing case could be: schedules: Sequence[ScheduleDefinition] = ...
sensors: Sequence[SensorDefinition] = ...
# one may question why this returns a list of AssetsDefinition's but still need to be provided separately
asset_checks: Sequence[AssetsDefinition] = load_asset_checks_from_modules([checks_module])
# ok...this assets type hint is a separate issue that we worry about later...
assets: Sequence[Union[AssetsDefinition, SourceAsset, CacheableAssetsDefinition]] = load_assets_from_modules([assets_modle])
defs = Definitions(
assets=assets,
asset_checks=asset_checks,
schedules=schedules,
sensors=sensors,
) |
Perhaps an alternative could be an easy transformation API that coerces an AssetsDefinition to an AssetChecksDefinition, assuming the properties line up. That way we don't have to have this boilerplate in multiple places, at least |
1570691
to
203c228
Compare
1c711a7
to
9dd1552
Compare
203c228
to
1fff846
Compare
9dd1552
to
42f1009
Compare
switched to a coercion method on AssetsDefinition
python_modules/dagster/dagster/_core/definitions/load_asset_checks_from_modules.py
Outdated
Show resolved
Hide resolved
..._modules/dagster/dagster_tests/definitions_tests/asset_check_tests/test_load_from_modules.py
Outdated
Show resolved
Hide resolved
Graphite Automations"Add a 'docs-to-migrate' label to PRs with docs" took an action on this PR • (12/18/24)1 label was added to this PR based on Christopher DeCarolis's automation. |
2219a42
to
2853ef1
Compare
2219a42
to
2b63520
Compare
081e1e8
to
82f47fd
Compare
2b63520
to
50fb6a7
Compare
82f47fd
to
4292bbd
Compare
50fb6a7
to
80674c2
Compare
e31896e
to
3c7b7af
Compare
80674c2
to
8e93c2e
Compare
3c7b7af
to
2b54d94
Compare
8e93c2e
to
0291fcc
Compare
2b54d94
to
43c784b
Compare
0291fcc
to
c2914bc
Compare
43c784b
to
35682c5
Compare
c2914bc
to
db63c88
Compare
35682c5
to
66e1db2
Compare
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.
make sure you remove the changelog section which seems no longer valid.
db63c88
to
e99f85b
Compare
66e1db2
to
254076c
Compare
e3763d4
into
dpeng817/delete_extra_source_assets
## Summary & Motivation We can further simplify the load_asset_from_x code path by making the asset checks loader return AssetsDefinitions, and changing the assertions to just make sure that the returned assets only contain checks. ## How I Tested These Changes Altered existing tests
## Summary & Motivation We can further simplify the load_asset_from_x code path by making the asset checks loader return AssetsDefinitions, and changing the assertions to just make sure that the returned assets only contain checks. ## How I Tested These Changes Altered existing tests
## Summary & Motivation We can further simplify the load_asset_from_x code path by making the asset checks loader return AssetsDefinitions, and changing the assertions to just make sure that the returned assets only contain checks. ## How I Tested These Changes Altered existing tests
## Summary & Motivation We can further simplify the load_asset_from_x code path by making the asset checks loader return AssetsDefinitions, and changing the assertions to just make sure that the returned assets only contain checks. ## How I Tested These Changes Altered existing tests
Summary & Motivation
We can further simplify the load_asset_from_x code path by making the asset checks loader return AssetsDefinitions, and changing the assertions to just make sure that the returned assets only contain checks.
How I Tested These Changes
Altered existing tests