Replies: 2 comments 4 replies
-
@schrockn has suggested |
Beta Was this translation helpful? Give feedback.
-
+1
+1
I favor this direction for the near term. As a helper function, I think the cost of offering this is pretty low, and I think it will be the easiest thing to adopt incrementally if you're already using load_assets_from_*.
I'm optimistic about this direction, but I think it will take a little while to get there, and I'm not convinced that it will be the right API in all cases. Users in the existing paradigm might have structured things in a way that makes this difficult to take advantage of, and there's value in offering a more incremental path to bulk loading asset checks.
We considered this in the early design phase of asset checks and decided against it. Here are some of the reasons:
|
Beta Was this translation helpful? Give feedback.
-
A theme across internal and now external dogfooding is that it's easy to forget to include checks in the Definitions object.
@asset_check
. We don't haveload_asset_checks_from_*
methods@asset(check_specs=[...])
are included along with the asset. Confusing difference vs@asset_check
dagster dev -f repo.py
and don't define aDefinitions
we grap all asset defs but not checksThis gives a bad first impression of checks, so we should mitigate it. Our options:
1. Documentation (definitely)
We need to emphasize
Definitions(asset_checks=[...])
in our docs.2. Load asset checks by default (definitely)
Load checks along with assets when you call
dagster dev -f repo.py
without adefs = Definitions(...)
.3.
load_asset_checks_from_*
We could offer a compliment to
load_assets_from_*
. My concerns here are that you still have to remember to doand you likely always will do a matching
load_assets...
andload_asset_checks...
. Still, I think this is an improvement versus the current4.
load_defs_from_*
(planned post 1.5)We've discussed a generic function for loading all definitions from a module.
This handles the concerns about duplicate
load_assets...
andload_asset_checks...
. It's also a larger change that we won't be able to make for 1.5 this week. Users on existingload_assets_...
methods would have to migrate.5. Reference @asset_checks on @asset
Change the APIs to something to the tune of
and include the checks along with the asset.
Definitions(asset_checks=[...])
, but could leave it for rare use cases where users can't pass the check in to the assetBeta Was this translation helpful? Give feedback.
All reactions