dagster
dagster copied to clipboard
`load_asset_checks_from_module` sometimes returns `AssetsDefinition`s instead of `AssetChecksDefinition`s
To reproduce:
from dagster import AssetChecksDefinition, asset_check, load_asset_checks_from_current_module
@asset_check(asset="asset1")
def check1(): ...
assert isinstance(check1, AssetChecksDefinition)
asset_checks = load_asset_checks_from_current_module(asset_key_prefix=["prefix1"])
assert isinstance(asset_checks[0], AssetChecksDefinition)
This is because load_asset_checks_from_current_module
calls _checks_with_attributes
, which calls prefix_assets
, which calls AssetChecksDefinition.with_attributes
, which returns an AssetsDefinition
, not an AssetChecksDefinition