dbt-utils
dbt-utils copied to clipboard
`pivot` macro `quote_identifiers` not working
Describe the bug
The pivot macro is not actually quoting the column
even after setting quote_identifiers= true
.
Steps to reproduce
I create a model that looked like this
Expected results
Was expecting the Month
column to quoted in the compiled model.
This is how the compiled model looks like
Actual results
Screenshots and log output
This is error log
System information
The contents of your packages.yml
file:
packages:
- package: dbt-labs/dbt_utils
version: 1.1.1
Which database are you using dbt with?
- [x] postgres
- [ ] redshift
- [x] bigquery
- [ ] snowflake
- [ ] other (specify: ____________)
The output of dbt --version
:
Core:
- installed: 1.6.6
- latest: 1.7.11 - Update available!
Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
Plugins:
- bigquery: 1.6.7 - Update available!
- postgres: 1.6.6 - Update available!
At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
Additional context
Are you interested in contributing the fix?
From my investigation, it looks like in the pivot
macro we never quote the pivot column.
The line no 72 should have been adapter.quote(column)
. After doing this, the above error goes away and the column is actually quoted. Correct me if I got it wrong.