Matthew Weiner
12/17/2025, 10:28 PMdata_tests:
- elementary.exposure_schema_validity:
config:
tags: ["elementary"]
And when I run with dbt, I get the following:
Compilation Error in test elementary_exposure_schema_validity_<model_a>_ (<path/to/model_a>.yml)
dbt was unable to infer all dependencies for the model "elementary_exposure_schema_validity_<model_a>_".
This typically happens when ref() is placed within a conditional block.
To fix this, add the following hint to the top of the model "elementary_exposure_schema_validity_<model_a>_":
-- depends_on: {{ ref('<model_b>') }}
> in macro get_rendered_ref (macros/utils/graph/get_rendered_ref.sql)
> called by macro test_exposure_schema_validity (macros/edr/tests/test_exposure_schema_validity.sql)
> called by test elementary_exposure_schema_validity_<model_a>_ (<path/to/model_a>.yml)
I have not changed either model in any way other than adding this data test. The exposures look something like this:
exposures:
- name: exposure1
type: application
maturity: high
owner:
name: <>
email: <>
depends_on:
- ref('model_a')
description: <>
meta:
repository_url: "<git repo>"
contact_slack: "<slack_channel>"
criticality: "medium"
source_tables:
- "<source_a>"
referenced_columns:
- column_name: "model_a_col1"
description: "Column 1 description"
node: ref('model_a')
- name: exposure2
type: application
maturity: low
owner:
name: <>
email: <>
depends_on:
- ref('model_a')
- ref('model_b')
description: <>
meta:
repository_url: "<git repo>"
contact_slack: "<slack_channel>"
criticality: "medium"
source_tables:
- "<source_a>"
- "<source_b>"
referenced_columns:
- column_name: "model_a_col1"
description: "Column 1 description"
node: ref('model_a')
- column_name: "model_b_col2"
description: "Column 2 description"
node: ref('model_b')
Do you have any information on the cause of this issue, and how I might be able to resolve it?kapa.ai
12/17/2025, 10:28 PMkapa.ai
12/17/2025, 10:29 PM