https://dagster.io/ logo
#ask-ai
Title
# ask-ai
s

Shane Keller

03/06/2024, 11:20 PM
Is there a way to use one asset as a dependency of another asset without having to define an AssetKey
s

Scout

03/06/2024, 11:20 PM
Yes, there is a way to use one asset as a dependency of another asset without having to define an
AssetKey
. You can specify asset dependencies directly by referencing the asset functions or the assets themselves. Here's an example from the documentation that demonstrates how to define dependencies between assets:
Copy code
python from dagster import asset  @asset def upstream_asset():     ...  @asset def downstream_asset(upstream_asset):     ...
In this example,
downstream_asset
depends on
upstream_asset
, and the dependency is declared by simply passing
upstream_asset
as a parameter to
downstream_asset
. This approach allows you to define dependencies without explicitly using
AssetKey
.