[ASSET CHECKS] Building asset checks factories and comments about asset checks documentation #23548
Unanswered
louistransfer
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While the Dagster documentation has been really helpful and clear so far for core components (assets, jobs, sensors...), I find the asset checks documentation quite confusing. Here is an example : this code sample is a complete anti-pattern as the asset check loads a csv instead of checking data on the output pandas dataframe. There are no examples of asset checks on a pandas dataframe dependency.
In the "Using a factory" section, same issue, the asset check is not checking actual asset data : https://docs.dagster.io/concepts/assets/asset-checks/define-execute-asset-checks#using-a-factory
It is performing a SQL call using a resource rather than actually checking the asset.
In my view, it seems really difficult to deploy asset checks factories in production compared to asset factories which work really well. Most of the time, using the same asset checks for multiple clients would be really useful, however I couldn't find enough documentation to understand where the asset check keys should be declared.
I have been trying this factory pattern. I am using this code in the store_a/assets/sales.py file :
Then importing it in my init.py file :
However I get this AssetChecksKey error :
UserWarning: Error loading repository location harvest_flow.dagster_etl:KeyError: AssetCheckKey(asset_key=AssetKey(['store_a', 'sales', 'raw_sales_store_a']), name='check_raw_sales_store_a_contains_nulls')
Should I declare this asset check somewhere in the target asset ?
Being able to perform checks upstream in our data ingestion process would be really nice in addition to dbt asset checks, which are working flawlessly.
In particular, more documentation on about how to handle this part of the factory asset would be helpful (especially the naming and handling of "asset_to_check"):
Beta Was this translation helpful? Give feedback.
All reactions