Describe the bug
When setting the escape left and right variables, ghost record and unknown record column names are not escaped in the stg macro.
Also, column names are not escaped in the sat macro either.
We have a column name of "no" (number) that gets converted to False, resulting in compilation errors
Environment
- dbt version: cloud: latest
- datavault4dbt version: 1.14.0
- Database/Platform: databricks
To Reproduce
Please provide:
- Set variables: escape_char_left: '
' escape_char_right: ''
- Create a source table with 'no' as a column name
- Create a stage model from that table and set enable_ghost_records: 'true'
- Try to build the stage model
- Notice that it errors with unable to concat bool += string
A clear and concise description of what you expected to happen.
I expect the stage model to be built properly without error and that the column names are properly escaped to avoid this issue. I was able to override the macro and add escaping for the stage model, but it reappeared in the sat_v0 model so I ended up renaming the column to avoid the issue entirely.
If you compile any stage or sat model, you will notice that column names are not escaped.
Additional context
I would expect the escaping to use adapter.quote('string') as it is a more reliable method of quoting column names that adapts to the underlying technology instead of relying on a custom escaping mechanism.
Describe the bug
When setting the escape left and right variables, ghost record and unknown record column names are not escaped in the stg macro.
Also, column names are not escaped in the sat macro either.
We have a column name of "no" (number) that gets converted to
False, resulting in compilation errorsEnvironment
To Reproduce
Please provide:
' escape_char_right: ''A clear and concise description of what you expected to happen.
I expect the stage model to be built properly without error and that the column names are properly escaped to avoid this issue. I was able to override the macro and add escaping for the stage model, but it reappeared in the sat_v0 model so I ended up renaming the column to avoid the issue entirely.
If you compile any stage or sat model, you will notice that column names are not escaped.
Additional context
I would expect the escaping to use
adapter.quote('string')as it is a more reliable method of quoting column names that adapts to the underlying technology instead of relying on a custom escaping mechanism.