[Bug] Unit Test fails when using adapter get_relation function #10891
Labels
bug
Something isn't working
triage
unit tests
Issues related to built-in dbt unit testing functionality
Is this a new bug in dbt-core?
Current Behavior
Currently we have an existing macro where we alter SQL behavior based on presence or absence of a model
The code works fine without any issue
When trying to unit test this model it fails with below error
'str object' has no attribute 'database'.
narrowed it down to usage of the below line
{%- set relation = adapter.get_relation(this.database, this.schema, this.table) -%}
Expected Behavior
The "this" in adapter is treated as a string rather than a relation .
using
{{ this }}
in schema yml is not possiblethe "this" inside adapter relation should be a relation
Steps To Reproduce
create below model and unit test
Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: