[Bug] SQL compilation error when running --empty
flag on on model that utilizes dbt_utils.union_relations()
macro
#10766
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
empty
Issues related to the --empty CLI flag
unit tests
Issues related to built-in dbt unit testing functionality
Is this a new bug in dbt-core?
Current Behavior
When running the simple model below with the
--empty
flag I get the following error:Expected Behavior
The
--empty
model should be built successfully like what happens with an explicit union that does not leveragedbt_utils.union_relations()
Steps To Reproduce
dbt_utils.union_relations()
Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
A very similar bug was brought up in #10673 and solved by tacking
.render()
onto the end of the relation reference in the pre-hook causing trouble.If I try and translate that solution to the
dbt_utils.union_relations()
macro here I get a failure because theunion_relations
macro is expecting a relation:Even if the above solution had worked, I would still feel like needing to tack on the
.render()
after every relation would be more of a workaround than a solution for this example.The text was updated successfully, but these errors were encountered: