-
Notifications
You must be signed in to change notification settings - Fork 40
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
[CT-2819] default__alter_relation_add_remove_columns macro does not use quoting with case sensitive Snowflake relation #256
Draft
McKnight-42
wants to merge
26
commits into
main
Choose a base branch
from
mcknight/ct-2819
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
68bfa34
initial add of test and update to columns.sql
McKnight-42 d6ad15c
update test to try and check against postgres
McKnight-42 3c922d4
minor update to tests and push up
McKnight-42 8d8bad6
Merge branch 'main' of https://github.com/dbt-labs/dbt-adapters into …
McKnight-42 b221b09
revert macro update for testing
McKnight-42 2765bf0
readd adapter.quote
McKnight-42 de1893a
update fixtures and tests (remove breakpoints) test against snowflake…
McKnight-42 7fdf639
pre-commit fixes and changelog
McKnight-42 ade5d98
Merge branch 'main' of https://github.com/dbt-labs/dbt-adapters into …
McKnight-42 0cb0583
pre-commit fix
McKnight-42 52cb472
pull new test out of old OnSchemaChange, to create own bass and test …
McKnight-42 f70650b
remove uneeded test class
McKnight-42 098fcf5
Merge branch 'main' of https://github.com/dbt-labs/dbt-adapters into …
McKnight-42 50fb497
Merge branch 'main' into mcknight/ct-2819
McKnight-42 5bc06b6
Merge branch 'main' of https://github.com/dbt-labs/dbt-adapters into …
McKnight-42 29bd5ae
updating test and model names based on feedback, pushing to test in o…
McKnight-42 7868857
Merge branch 'mcknight/ct-2819' of https://github.com/dbt-labs/dbt-ad…
McKnight-42 1d83c86
updating test and model names based on feedback, pushing to test in o…
McKnight-42 13f3f35
update query to use adapter.quote
McKnight-42 253686a
Merge branch 'main' of https://github.com/dbt-labs/dbt-adapters into …
McKnight-42 ed01f64
modify fixture to take into account databases that don't append if co…
McKnight-42 35710fe
swap double-quotes for single-quotes
McKnight-42 ecacae7
update run_dbt_and_capture command
McKnight-42 27d3cab
update run_dbt_and_capture command
McKnight-42 002bba5
swap command flag
McKnight-42 8670ca2
minor reformat
McKnight-42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: add new test to test case sensitivity for column quoting in incremental models that use append_new_columns | ||
time: 2024-07-09T14:54:39.526077-05:00 | ||
custom: | ||
Author: McKnight-42 | ||
Issue: "250" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we always want to quote? Or is there a config that we need to condition on, similar to the quote policy for relation names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adapter.quote leverages the same quote policy as relation names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikealfare are you thinking something like this (for relations) or this (for columns)?
In this particular case, I think we need to match the quoting from here (which would mean always quoting via
adapter.quote()
). I forget the exact details -- and I could be wrong! -- but there's some notes under the "Root Cause" toggle in #250 (comment).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: here are the primary resources I've been using when researching quoting or case-sensitive issues:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbeatty10 oh these are really cool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colin-rogers-dbt
adapter.quote()
will always quote.@dbeatty10 If the objective is to always quote the column in this case, that's fine. I just know we've run into issues before where we quote something that doesn't get quoted, or vice versa, and then it fails a condition in a filter where it's supposed to pass. I haven't seen it with columns, so maybe it doesn't apply here.