-
Notifications
You must be signed in to change notification settings - Fork 43
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
[Bug] generic test are not working with fields with special characters #291
Comments
@gekas93 would you be able to share what are the special characters in your column? Also what happens if you quote them in your dbt model? |
Thanks for your quick answer @amychen1776 .
I have a select * in those queries with the issues but I have chaged the query for having only two quoted columns, like this: select "UUID-field1", "UUID-field2"
from {{ source('xxxx', 'xxxxx') }} And this is the compiled code of the unique test: select
count(*) as failures,
count(*) != 0 as should_warn,
count(*) != 0 as should_error
from (
select
UUID-field1as unique_field,
count(*) as n_records
from "xxxxx"."xxxxx"."xxxxxxxx"
where UUID-field1 is not null
group by UUID-field1
having count(*) > 1
) dbt_internal_test And the issue: So quoting them it's the same as not quoting them. |
@gekas93 do you have quoting configured in any of your yml files like project.yml? https://docs.getdbt.com/reference/project-configs/quoting |
@amychen1776 No, we have the default behavior (quoting = True) and it's quoting the database, identifier and schema but not the fields. |
Is this a new bug?
Current Behavior
When I add some tests to my yml file in a field with special characters, I receive a sintax error.
Ex:
Response:
column uuid does not exists in base_autoportal_reference_data
Expected Behavior
Tests executed perfectly.
Steps To Reproduce
Relevant log output
No response
Environment
Additional Context
It's because the column names are not quoted in the tests.
At the moment, I have overwritten the macro tests with something like this:
The text was updated successfully, but these errors were encountered: