-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add column quotes in macro to avoid build failure #8529
Add column quotes in macro to avoid build failure #8529
Conversation
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: @seanglynn-thrive |
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main dbt-labs/dbt-core#8529 +/- ##
==========================================
- Coverage 86.60% 85.11% -1.50%
==========================================
Files 175 175
Lines 25638 25638
==========================================
- Hits 22205 21822 -383
- Misses 3433 3816 +383
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
Thanks for opening this PR @seanglynn-thrive ! I just created and added changelog entry file for this PR: Could you do the following?
In terms of adding new test cases, the problem and solution are similar to #919, and you can use that PR for inspiration for how to implement. Specifically, we'll want to make sure the tests verify that both unquoted and quoted identifiers still work when appending new columns (in addition to a quoted identifier with a reserved keyword). |
@dbeatty10 |
Co-authored-by: Doug Beatty <[email protected]>
Nice @seanglynn-thrive 😎 I left a review comment within the changelog entry -- could you take a look? Here's the example test from dbt-labs/dbt-bigquery#919. Since the example above is from the dbt-bigquery repo, but your PR is within the dbt-core repo, you can use a search similar to the following to find a relevant test to modify (or copy-paste from):
Here's some lines of code you could take a peek at:
Adding / modifying tests can be tricky sometimes, so just let us know if you run into any issues and need a hand. |
Accidental approval -- need to wait for test cases to approve
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days. |
Thanks for taking the time to open this PR @seanglynn-thrive! Since opening, we've decoupled dbt Adapters from dbt Core, and this code now lives in a separate repo: dbt-adapters. A consequence of the decoupling is that PR can't be merged anymore as is, so we're closing it. For more context see #9171. The linked issue has already been transferred. Please don't hesitate to re-open your proposed code changes within this PR in the dbt-adapters repo. |
Resolves: dbt-labs/dbt-adapters#157
Problem
The macro:
default__alter_relation_add_remove_columns
generated by incremental config:on_schema_change = 'append_new_columns'
is causing our build to fail when it encounters columns that are named as reserved keywords BigQuery SQL syntax.Solution
Wrap column reference with quotes to avoid a SQL exception being thrown.
Checklist