You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
In my model_b.sql I have something like {% set val_list = dbt_utils.get_column_values(table=ref('model_a'), column='VAL') %}. I try to run a dbt build using a defer flag. model_a does not exist in the the db & schema that I am building in, yet it still will not use the db & schema I am telling it to defer to. When I run dbt ls -s 1+model_b, dbt does recognize that model_a is upstream and being referred to.
Expected Behavior
In the above example, the dbt_utils macro should use the defer db & schema to get the column values from model_a.
Steps To Reproduce
I have model_b like such
{% set val_list = dbt_utils.get_column_values(table=ref('model_a'), column='VAL') %}
{% for val in val_list %}
select
col_1
, null as col_2
, date_trunc('month', col_3) as col_3
, '{{ val }}' as val
from {{ ref('model_ab') }}
{%- endfor -%}
Then run dbt run -s model_b+1 in the dev environment with a defer to the prod environment.
Relevant log output
Compilation Error in model model_b (models/model_b.sql)
In get_column_values(): relation DEV.SCHEMA.MODEL_A does not exist and no default value was provided.
Environment
- dbt: 1.8.7
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Is this a new bug in dbt-core?
Current Behavior
In my model_b.sql I have something like
{% set val_list = dbt_utils.get_column_values(table=ref('model_a'), column='VAL') %}
. I try to run a dbt build using a defer flag. model_a does not exist in the the db & schema that I am building in, yet it still will not use the db & schema I am telling it to defer to. When I rundbt ls -s 1+model_b
, dbt does recognize that model_a is upstream and being referred to.Expected Behavior
In the above example, the dbt_utils macro should use the defer db & schema to get the column values from model_a.
Steps To Reproduce
I have model_b like such
Then run
dbt run -s model_b+1
in the dev environment with a defer to the prod environment.Relevant log output
Environment
- dbt: 1.8.7
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: