[Bug] unit test use source name for cte name and source identifier for table name #10667
Closed
2 tasks done
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
unit tests
Issues related to built-in dbt unit testing functionality
Is this a new bug in dbt-core?
Current Behavior
I try to unit test a model that has a source table configured with both identifier and name. When we run the unit test, the test fails with error
source config:
model.sql:
select * from {{ source("test_table") }}
After checking the log, the generated sql uses source name for the generated cte name and source identifier to replace the source table name.
__dbt__cte__test_table as ( xxxx ) select * from __dbt_cte__test
If we rename the source identifier to match the name, then the error will be gone.
Expected Behavior
unit test should use same way to generate both the cte name and source table name
Steps To Reproduce
Follow the steps in the current behavior.
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
dbt-athena adapter
The text was updated successfully, but these errors were encountered: