From 34fd4a6bcd6b135a34f4df66c0f14ebbefe16bb0 Mon Sep 17 00:00:00 2001 From: Tudor Date: Wed, 1 Jul 2026 21:53:11 +0100 Subject: [PATCH] fix(dbt): declare dim_school -> int_ofsted_latest dependency explicitly int_ofsted_latest is only ref()'d inside a conditional block, so dbt couldn't infer the edge and failed to compile dim_school. Add the -- depends_on hint dbt recommends. No runtime behaviour change: the adapter.get_relation guard still handles the pre-Ofsted-pipeline case. Co-Authored-By: Claude Opus 4.8 --- pipeline/transform/models/marts/dim_school.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pipeline/transform/models/marts/dim_school.sql b/pipeline/transform/models/marts/dim_school.sql index 3b47d47..fba0296 100644 --- a/pipeline/transform/models/marts/dim_school.sql +++ b/pipeline/transform/models/marts/dim_school.sql @@ -1,5 +1,10 @@ -- Mart: Canonical school dimension — one row per active URN +-- int_ofsted_latest is only ref()'d inside a conditional block below (it may not +-- exist before the Ofsted pipeline first runs), so declare the dependency +-- explicitly for dbt's DAG. +-- depends_on: {{ ref('int_ofsted_latest') }} + with schools as ( select * from {{ ref('stg_gias_establishments') }} )