-
Notifications
You must be signed in to change notification settings - Fork 175
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
respect-snowflake-quoting.sql #923
Conversation
Quoting isn't respected when altering Snowflake tables with non-ansi-compliant names https://github.com/dbt-labs/dbt-core/issues/8080
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR. CLA has not been signed by users: @ludwig-solita |
CLA is now signed |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
Thanks for submitting the PR. Got some tests failures to work out before we can review and merge. But quoting issues are always important to be accounted for. It feels like there are always more Snowflake edge cases to account for 😄 Also, make sure that you adapt your example of the failure into a test so we can track this going forward 🖖 |
@VersusFacit - Your welcome :) Yeah I agree, there are a few quirks. I think quoting shouldn't have been allowed in the first place. How are the tests written? It's my first contribution to this project. The below code would esentially be the test. Configure project.yml to use quoting for identifiers
Create the table with CTAS
Add new columns
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: ludwig-sewall.
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: ludwig-sewall, [email protected].
|
Problem
Quoting isn't respected when altering Snowflake tables with non-ansi-sql compliant names. This throws an error when syncing columns in incremental models. I didn't create a new issue since this already seems to recognize the problem
dbt-labs/dbt-adapters#250
Solution
Instead of just using column.name for the alter statements I've added the adapter.quote to properly respect the quoting configuration in yaml-files
Checklist
I have read the contributing guide and understand what's expected of me
I have run this code in development and it appears to resolve the stated issue
This PR includes tests, or tests are not required/relevant for this PR
It's a quite minor change.
This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
It does affect the adapter. I've had discussions with @ernestoongaro regarding the problem.