https://dagster.io/ logo
#ask-community
Title
# ask-community
m

Mark Newman

09/08/2022, 3:45 PM
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

Stephen Bailey

09/08/2022, 4:13 PM
I think you want to use
non_argument_deps={AssetKey(["transformation", "source", "delta"])},
m

Mark Newman

09/08/2022, 4:26 PM
Thanks for the reply.
I did in fact use AssetKey as in your reply. Might there be something else to do?
s

Stephen Bailey

09/08/2022, 4:58 PM
Not sure, unfortunately
s

sandy

09/08/2022, 9:31 PM
would you mind showing the code where the transformation/source/delta asset is defined?
m

Mark Newman

09/09/2022, 2:25 PM
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

sandy

09/09/2022, 3:16 PM
glad you were able to work it out!
3 Views