thank you for your help in advance. I'm using dbt and am at the point in the jaffle_shop tutorial to set up sources. I set up everything as the tutorial states and everything has been working up until now.
File tree
jaffle_shop
- models
- marts/core
- dim_customers.sql
- fct_orders.sql
- staging/jaffle_shop
- stg_customers.sql
- stg_orders.sql
- stg_payments.sql
- src_jaffle_shop.yml
- dbt_project.yml
The src_jaffle_shop.yml looks like this:
version: 2
sources:
- name: jaffle_shop
schema: dbt_jallard
database: dhaus
tables:
- name: customers
- name: orders
- name: payment
An example of the staging files is this:
with customers as (
select
id as customer_id,
first_name,
last_name
from {{ source('dbt_jallard','customers') }}
-- from dbt_jallard.customers
)
select * from customers
As you can see I commented out the regular sql from-statement. When using that statement it works as intended, but when I try using the source() reference, I get this error:
Model 'model.jaffle_shop.stg_customers' (models/staging/jaffle_shop/stg_customers.sql) depends on a source named 'dbt_jallard.customers' which was not found
The database is configured correctly because it works when calling from dbt_jallard.customers but for some reason using {{ source('dbt_jallard','customers') }} gives this error.
Any insight would be helpful. Thank you!