Hi! I'm trying to understand the latest best pract...
# ask-community
r
Hi! I'm trying to understand the latest best practices by looking at the Fully Featured Project Example. Looking at the code, I cannot understand how dagster knows that the dbt model
story_daily_stats
depends on the
stories
asset.
story_daily_stats.sql
refers to
source('core', 'stories')
declared in sources.yml. Dagster manages to link this source table with the
stories
asset. I could be wrong but is it done implicitly by using the same asset key on both sides? • The original
stories
asset is keyed:
snowflake.core.stories
dagster-dbt
seems to set the asset key to
schema.model_name
with the ability to set
key_prefix
but I can't find where in this project the prefix would be set to
snowflake
🤷
j
Hey @Remi Gabillet you’re correct that the dependencies are determined by looking at the asset keys. You can see on this line that the dbt assets are all given the key prefix
snowflake
so that key prefix will be pre-pended to all of the sources defined in the sources.yml. Those sources are then matched to the assets with the corresponding asset keys. if you haven’t seen it yet, our dbt tutorial does a good job explaining this and how to do this for your own dbt project
r
Thanks you @jamie. This all makes sense now. I was close but I missed that line!