Hi, I am experimenting with asset non_argument_de...
# ask-community
m
Hi, I am experimenting with asset non_argument_deps. In my current test to have one asset depend on another, Dagster successfully resolves the dependence and my code runs correctly. However, the Dagster resolution code warns that it matches on the name only, not on the full key. I am concerned that when I use the same name but different key prefixes for two assets in the future, the resolver will not know which one to choose. How can I avoid this problem? Relevant code and warning below: @asset( name="changes", group_name="transformation", key_prefix=["transformation", "transformation"], non_argument_deps={("transformation", "source", "delta")}, required_resource_keys={"db"}, config_schema={}, ) /env/lib/python3.10/site-packages/dagster/_core/definitions/resolved_asset_deps.py23 ExperimentalWarning: Asset ["transformation", "transformation", "changes"]'s dependency 'delta' was resolved to upstream asset ["transformation", "source", "delta"], because the name matches and they're in the same group. This is experimental functionality that may change in a future release. To mute warnings for experimental functionality, invoke warnings.filterwarnings("ignore", category=dagster.ExperimentalWarning) or use one of the other methods described at https://docs.python.org/3/library/warnings.html#describing-warning-filters. Thanks, Mark
s
I think you want to use
non_argument_deps={AssetKey(["transformation", "source", "delta"])},
m
Thanks for the reply.
I did in fact use AssetKey as in your reply. Might there be something else to do?
s
Not sure, unfortunately
s
would you mind showing the code where the transformation/source/delta asset is defined?
m
My apologies to you both for taking your time. The issue was that the key prefix of the non-argument dependence was not what I thought it was. I set the prefix values from variables and, despite previous debugging, hadn't noticed my error. The code now runs correctly and without reporting the warning. Thanks for the attention.
s
glad you were able to work it out!