[Bug] Update command-based logic in compiled_code
context member, to match sql
#9502
Closed
2 tasks done
Labels
Is this a new bug in dbt-core?
Current Behavior
In #9040, we added
defer_relation
for all tasks that perform deferral.Previously, there was dynamic routing logic in the
sql
+compiled_code
context members that checked for the existnece ofdefer_relation
and overwrote the "compiled code" to use duringclone
.#9040 updated the dynamic routing logic for the
sql
context member (based on the running task), but not thecompiled_code
context member.These need to be the same. Otherwise, I might
build
a model with deferral and, depending on whether the materialization uses{{ sql }}
or{{ compiled_code }}
, get a different (inconsistent) result.Expected Behavior
There should be no difference between
{{ sql }}
and{{ compiled_code }}
for SQL models.Steps To Reproduce
main
branchcompiled_code
instead ofsql
, e.g. dbt-snowflake's incremental materializationRelevant log output
That ain't right!
Environment
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: