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

remis haroon

07/19/2023, 10:28 AM
hello.. my dbt_model’s source is a dasgter asset out of dbt, how can I refer this asset inside a dbt model definiton? the dagster asset =
Copy code
@asset(
    group_name=". .... ",
    io_manager_key="..   ",
)
def dld_sales():
dbt model =
Copy code
with source as (
    select * from {{ ref("dld_sales") }}
),
gives me error: Model ‘model.dbt_project.stg_dld_sales’ (models/staging/stg_dld_sales.sql) depends on a node named ‘dld_sales’ which was not found
m

Mike Stanley

07/19/2023, 11:01 AM
"Model... depends on a node named... which was not found" is a dbt error. dbt is throwing this error because ref() is an internal dbt function that is looking for model definitions, and there is no model definition for dld_sales so it doesn't know what to do next. dbt uses a separate concept called sources to define entry points for data so it understands where to obtain data from to start its process - you need to have set up the materialised data from dld_sales as a source in dbt The dagster dbt tutorial takes you through setting up sources in part one and creating assets that dagster can materialise that dbt can then use as sources in part three
1
c

claire

07/19/2023, 9:23 PM
+1 to Mike's comment above, you'll need to define a dbt source that shares the same name as your
dld_sales
asset