You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using "include_missing_columns": true with my postgres data and one of the column names of the table to mock includes a reserved keyword (in my case reference), the test fails to compile. For context - the mocked source table contains the dbt_utils.star macro, in case that's relevant.
12:26:22 Database Error in test test_manual_overrides (tests/unit/test_manual_overrides.sql)
12:26:22 syntax error at or near "references"
12:26:22 LINE 14: ...col1,col2,col3,references...
Looking at the query that is written based on the test we can see, that the column names that are selected are not quoted, leading to the above error.
This is the specific part of the query causing problems:
select
col1,
col2,
col3,
referencesfrom
(
select*from"db"."raw"."table_name"where
false) as m2
Any way to change this to always quote the column names?
I would also like to have this implemented for a different use case. My source table columns contain spaces in them which is currently not handled well and would be fixed by quoting the column name.
Ofcourse another solution would be to get rid of spaces in the column names, but that is not always in our control.
Seems like there is already a pull request for it :).
When using
"include_missing_columns": true
with my postgres data and one of the column names of the table to mock includes a reserved keyword (in my casereference
), the test fails to compile. For context - the mocked source table contains thedbt_utils.star
macro, in case that's relevant.Looking at the query that is written based on the test we can see, that the column names that are selected are not quoted, leading to the above error.
This is the specific part of the query causing problems:
Any way to change this to always quote the column names?
This is how dbt_utils does it, see here:
The text was updated successfully, but these errors were encountered: