Skip to content

How do you add an upstream asset to your dbt assets? #9636

Answered by OwenKephart
OwenKephart asked this question in Q&A
Discussion options

You must be logged in to vote

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:

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, postgres_replica/orders and postgres…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by OwenKephart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant