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

geoHeil

02/14/2023, 10:02 AM
When referencing an upstream asset - how can I ensure the uniqueness of the name/reference? And potentially reference the asset explicitly i.e. by giving the full asset key / and having a nice alias in the function argument?
r

Rasmus Bonnevie

02/14/2023, 10:23 AM
are you referencing them in another asset definition? I think asset keys are unique by design? I almost exclusively use the
ins
argument of the decorator to define dependencies, it allows you to explicitly map input arguments to asset keys so that your dependencies are explicit.
g

geoHeil

02/14/2023, 10:24 AM
they keys are unique
but not neccessarily the argument name to an asset function
in particular not a readable one
think about an enterprise settings where schema foo and table bar might reside in two separate warehouses (on-prem and cloud) perhaps and have different contents (if not even schemata)
Probably I should go via the ins as well. But it is a bit of typograpic overhead. However, so far I would not see any other way
Do you see anything else?
r

Rasmus Bonnevie

02/14/2023, 10:51 AM
the argument names to the asset functions are short-hands for keys, so if you don't want to use
ins
I think you'd be forced to make them unique. You might be able to do something using
@repository
with prefixes to define independent code locations, but that doesn't seem to be recommended.
g

geoHeil

02/14/2023, 11:20 AM
hm might be workable - let me explore the
ins
more
2 Views