-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Regression] Unit tests generate an sql with wrong CTE on models with alias #10605
Comments
Thanks for reporting this @jan-benisek ! This looks to me to have the same underlying root cause as dbt-labs/dbt-adapters#284. More detail here: dbt-labs/dbt-adapters#284 (comment) |
@dbeatty10 Thank you for looking into the issue. I have the same issue even with dbt-adapters = 1.4.0. The model is materialized="table" so workaround 3 does not work also. |
can I pick it ? |
Can confirm the same issue happens on source with different identifier as well. |
I am also getting the same error where we use a custom |
I thought this would be resolved in |
Is this a new bug in dbt-core?
Current Behavior
Unit tests fail due to wrong subquery name on input models with
alias
.Expected Behavior
I expect that the name of the CTE will be consistent with the
from
, regardless of alias.Steps To Reproduce
-t
. It only happens under our CI target where we have slightly different rules to target schemas etc. Not sure what could help, but let me know if I can add more details.If I have a model with
alias
:And a unit test on a table which has the aforementioned table as input:
Then I am running the unit test
dbt test --select "usage,test_type:unit" -t ci
, I am getting an error:Which of course does not work, because the generated SQL has different name of the CTE and the
from
:Relevant log output
No response
Environment
Which database adapter are you using with dbt?
redshift
Additional Context
No response
The text was updated successfully, but these errors were encountered: