Relationships schema test does not support expressions anymore #3790
Labels
bug
Something isn't working
dbt tests
Issues related to built-in dbt testing functionality
regression
Milestone
Describe the bug
Up until 0.20.x, the
relationships
test was commonly used with a column/field that is an expressionconcat(col_a, col_b)
. This was a way to support a relationship test on multiple keys.The macro was refactored in a way that breaks this use of it.
Previously, the column was aliased to
id
, so expressions were supported. But now that the column/field is not aliased anymore, the macro throws an "ambiguous column" error and produces invalid SQL.For example the JOIN condition looks like this now:
Steps To Reproduce
Use dbt > 0.19, use the relationships test with
concat(...)
Expected behavior
Supports relationship tests that include a JOIN on multiple keys
Screenshots and log output
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
Mac OSX
The output of
python --version
:Python 3.9.0
Additional context
Slack thread: https://getdbt.slack.com/archives/CBSQTAPLG/p1629717601126100
The text was updated successfully, but these errors were encountered: