[Bug] During persist_docs
, col names in the schema yml file should always be uppercased if we don't have a quote
config on the column
#1156
Labels
bug
Something isn't working
Is this a new bug in dbt-snowflake?
Current Behavior
If users have
columns.name
key in a mixed case - dbt does not correctly match the uppercased column name that comes from adescribe table ...
with what is in theschema.yml
file - therefor, column descriptions aren't added to the column.Expected Behavior
During the "matching process" - we should always uppercase the
columns.name
key no matter the case if the user doesn't specify thequote
config on the column (https://docs.getdbt.com/reference/resource-properties/quote).Steps To Reproduce
Project setup:
Run
^ What happens here....
select 1 as mixed_Case
- and what happens is Snowflake has this column as a uppercasedMIXED_CASE
(this is the default behaviour of Snowflake).MIXED_CASE
exist.MIXED_CASE
that comes from the describe, does not match what is in theschema.yml
which has that asmixed_Case
."MIXED_CASE" != "mixed_Case"
so we don't find a matching column description.What can users do about this
(A) They can quote the column name in the model
Here Snowflake has created a literal mixed case column name
mixed_Case
- the describe returns this exactly and we get a match in the schema.yml file -"mixed_Case" = "mixed_Case"
- therefor, we can apply the column description appropriately.Cons
Their table will have a literal mixed case column name which they may not want.
(B) They can uppercase / lowercase the column name in the schema yaml
For some reason, if the
columns.name
key is either:UPPERCASED
.lowercased
.dbt has some internal methods to match this correctly.
Cons
User have to have a different column casing style between their model code and their schema yml files.
Relevant log output
No response
Environment
Additional Context
If users don't specify the quote column config (https://docs.getdbt.com/reference/resource-properties/quote) - I propose we always uppercase the
columns.name
key like (B) above - even if the user is going to specify a mixed case column name in the schema yml file.The text was updated successfully, but these errors were encountered: