How do you add an upstream asset to your dbt assets? #9636
-
Asked on Slack: https://dagster.slack.com/archives/C01U954MEER/p1662050893763849 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When you load your dbt assets, Dagster determines which asset keys are upstream of your dbt assets based off of the sources that are defined in your dbt project. For example, if you have a version: 2
sources:
- name: postgres_replica
database: postgres_replica
schema: public
tables:
- name: orders
identifier: _airbyte_raw_orders
- name: users
identifier: _airbyte_raw_users (taken from: https://github.com/dagster-io/dagster/blob/master/examples/assets_modern_data_stack/dbt_project/models/sources.yml) Then Dagster will infer that there are two upstream asset keys for your dbt project, Now, if you create (or load) an asset which produces one of those asset keys, this asset will be upstream of whichever dbt assets consume these sources: |
Beta Was this translation helpful? Give feedback.
When you load your dbt assets, Dagster determines which asset keys are upstream of your dbt assets based off of the sources that are defined in your dbt project. For example, if you have a
sources.yml
file like this:(taken from: https://github.com/dagster-io/dagster/blob/master/examples/assets_modern_data_stack/dbt_project/models/sources.yml)
Then Dagster will infer that there are two upstream asset keys for your dbt project,
postgres_replica/orders
andpostgres…