-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate Source Yaml doesn't preserve capitalization on schema/table names, creates unusable yaml for BQ (probably others) #140
Comments
+1 to this for Snowflake with dbt 1.5.0. If I have a column name in my source called As a result if I add a - name: firstname
data_type: varchar
description: ""
tests:
- not_null the test will fail with: That's obviously because the Snowflake column is Perhaps by default the generated YAML should be with lower case column names, but have an option to quote things / preserve capitalisation , e.g. for my case would produce - name: firstName
data_type: varchar
description: ""
quote: true Then I can manually add my not null test to the above config and everything will work. I'm working with a Snowflake source table with around 150 columns in which the capitalisation is all over the place (all lower, all upper, camel case, title case and combinations of the aforementioned) and I can't control the case of the source column names. In this case codegen doesn't really help a lot since I would have to go through 150 columns and make sure the case is ok and manually add |
Makes sense that this should be a top-level option you can apply from codegen -- I'm going to be attempting some work to catch this package up based on the open issues -- thanks for sharing this! I'll keep you posted. |
Adding my vote that this would be a very useful parameter for have - both for generate_source_yaml and generate_model_yaml. Thank you @gwenwindflower for digging into this! |
there ended up being an open PR to do this, so i'm working with author of that to get these changes in, ideally covering the entire database -> schema -> table -> column chain in sources. |
@gwenwindflower Joining the party here - any plan/progress with supporting Currently I am using sed to add that param when generating: |
This also affects the generate_model_yaml when the model file names have mixed-case. It generates model yaml output with all lower-cased table and field names. |
Describe the bug
Generate Source Yaml doesn't preserve capitalization on schema/table names, creates unusable yaml for BQ (probably others)
Steps to reproduce
Generate source yaml against a table with capitalized schema/table names, with generate a source yaml with lower-case schema and table names.
Expected results
Preserve capitalization, preferable as an true/false in the function call.
Actual results
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:1.3
The operating system you're using:
Linux (dbt Cloud)
The output of
python --version
:dbt Cloud
Are you interested in contributing the fix?
Yes! Point me to the lines of code that do this and I'll happily contribute to a fix!
The text was updated successfully, but these errors were encountered: