Update int_order_items by replacing:
{{ source('tpch', 'orders') }} → {{ ref('stg_tpch_orders') }}
{{ source('tpch', 'lineitem') }} → {{ ref('stg_tpch_line_items') }}
In dbt’s recommended modeling pattern, sources should be referenced only in the staging layer. Downstream models (intermediate and mart/fact models) should reference staging models via ref(), not the raw source() directly. This keeps all raw-to-clean logic centralized in the staging layer and makes refactoring and documentation easier.
In the original DAG, int_order_items depends directly on tpch.orders and tpch.lineitem via source(), and staging models also depend on those same sources. That creates parallel paths from the sources and breaks the clean layered architecture.
By updating the int_order_items SQL to use:
from {{ ref('stg_tpch_orders') }}
join {{ ref('stg_tpch_line_items') }} ...
instead of:
from {{ source('tpch', 'orders') }}
join {{ source('tpch', 'lineitem') }} ...
you ensure that int_order_items sits entirely downstream of the staging layer. The new DAG becomes linear: sources → staging → intermediate (int_order_items) → any further marts. This improves modularity, reusability of cleaned logic, and makes the DAG easier to reason about and maintain.