-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
unique
schema test will fail on BigQuery if tested on column with name identical to model
#2061
Comments
Thanks for the report @tnightengale! The relevant code for this test is here: I think a similar issue affects the
I think it would be a good idea to update the Is this something you're interested in contributing a fix for? We're happy to help out however we can if so :) |
Hi @drewbanin ! Happy to contribute - it seems like a quick fix. I have a WIP local commit, but alas I am not overly familiar with github, and it seems I am unable to push/create a remote branch of my local branch, on this repository. I am sure I am just missing something obvious: could you help me understand how to open a remote branch on here? When running I have now run the following commands to re-clone the repository using SSH, and made changes:
Which yields the following error:
I'm sure this is obvious to other people but I actually don't really know all the protocols for contributing to public projects on github. Would you or anyone else lend some guidance? Is this expected behaviour because I am approaching it wrong, or do I need to do some kind of additional set up with my SSH key? |
Hey @tnightengale - cool to hear you have a local commit that addresses the issue! To contribute a change to this repo, you'll want to:
You can find more docs on how to do this here: https://github.com/fishtown-analytics/dbt/blob/dev/0.15.1/CONTRIBUTING.md#external-contributors This flow is necessary because you are not a member of the Looking forward to seeing the PR! |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
Still an issue |
The same underlying behavior in BigQuery might be the underlying root cause of all of the following reports:
|
Describe the bug
There appears to be a bug where the unique schema test will fail on BigQuery if it tests a column with an identical name to the model. This fails because of the compilation formatting, here is an example of the failing compiled test sql:
On the BigQuery data warehouse, the column name is ambiguous with the view/table, and thus the warehouse thinks the instruction is to
group by
a STRUCT object (ie, the entire view/table). This compilation issue can be solved with a simple alias of the column, to differentiate it from the view:Steps To Reproduce
unique
schema test to the column calledmock
dbt test --models mock
/target
Grouping by expressions of type STRUCT is not allowed at [9:14]
Expected behavior
The
unique
test should compile and pass without error.Screenshots and log output
If applicable, add screenshots or log output to help explain your problem.
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
The output of
python --version
:Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: