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
I am facing the following issue with dbt docs generate
We are using Snowflake and column names with double quotation marks meaning that in the schema.yml file when we specify the column name we have to do the following: '"ColumnName"' for tests to run.
The issues is that that then we get two columns references in the web documentation we get duplicates as you can see in the Screenshots
Steps To Reproduce
dbt docs generate
dbt docs serve
=> with config as in additional information
Expected behavior
Support a config in the schema.yml spec which would wrap a given column in quotes. That way, you could avoid specifying a column like ’“ColumnName”’, and instead just specify ColumnName with a quote: true flag provided. The docs should handle this config gracefully and it’ll be less typing/weirdness in the schema.yml file
If applicable, add screenshots or log output to help explain your problem.
System information
Which database are you using dbt with?
postgres
redshift
bigquery
snowflake
other (specify: ____________)
The output of dbt --version:
dbt version: 0.15.0
python version: 3.7.5
os info: Windows-10-10.0.18362-SP0
Additional information
the schema.yml :
models:
- name: Majority_DimUser
columns:
- name: '"UserKey"'
description: UserKey is one of the unique identifier for the User
tests:
- not_null
- unique
the dbt_project.yml
name: 'looker_wh'
version: '1.0'
source-paths: ["models"]
analysis-paths: ["analysis"]
test-paths: ["tests"]
data-paths: ["data"]
macro-paths: ["macros"]
target-path: "target" # directory which will store compiled SQL files
clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_modules"
quoting:
identifier: true
schema: true
The text was updated successfully, but these errors were encountered:
Thanks for the report @bcg0006! I just queued this issue up for our 0.16.0 release.
I think a viable syntax might look like:
models:
- name: Majority_DimUser
columns:
- name: UserKey
description: UserKey is one of the unique identifier for the User
quote: true # This would be new
tests:
- not_null
- unique
If dbt encountered a true value for the quote config, then dbt would quote the column before interpolating it into SQL queries (like in tests). dbt would not quote the column when rendering the documentation website. I suppose it would also be good to support this config at the model-level so that you wouldn't need to quote every mixed-case column explicitly.
The other broad approach we could take here would be to fetch the columns in the destination table in a dbt test, then determine the appropriate quoting/casing for the column. I think that's a pretty heavy-handed way to go about doing this, but I did want to raise it as a possible solution.
Describe the bug
I am facing the following issue with
dbt docs generate
We are using Snowflake and column names with double quotation marks meaning that in the
schema.yml
file when we specify the column name we have to do the following:'"ColumnName"'
for tests to run.The issues is that that then we get two columns references in the web documentation we get duplicates as you can see in the Screenshots
Steps To Reproduce
=> with config as in additional information
Expected behavior
Support a config in the
schema.yml
spec which would wrap a given column in quotes. That way, you could avoid specifying a column like’“ColumnName”’
, and instead just specifyColumnName
with aquote: true
flag provided. The docs should handle this config gracefully and it’ll be less typing/weirdness in the schema.yml file=> suggestion from @drewbanin
Screenshots and log output
If applicable, add screenshots or log output to help explain your problem.
System information
Which database are you using dbt with?
The output of
dbt --version
:Additional information
the
schema.yml
:the
dbt_project.yml
The text was updated successfully, but these errors were encountered: