Skip to content
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 quoting for sync all columns #8914

Conversation

DTchebotarev
Copy link

@DTchebotarev DTchebotarev commented Oct 26, 2023

Resolves dbt-labs/dbt-adapters#160
Resolves dbt-labs/dbt-adapters#63

Partial fix for dbt-labs/dbt-adapters#160, sounds like it will need follow up PRs in specific adapter repos (e.g. snowflake adatper)

Problem

When the sync_all_columns incremental option is used, the columns that are added and dropped are not quoted. This means that DBT will throw an error if the columns to be added or dropped have spaces or other unconventional names which require quotes.

Solution

Add adapter.quote() around column names.

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
  • 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
  • This PR includes type annotations for new and modified functions

@DTchebotarev DTchebotarev requested a review from a team as a code owner October 26, 2023 04:31
@cla-bot
Copy link

cla-bot bot commented Oct 26, 2023

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Dmitri Tchebotarev.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@github-actions
Copy link
Contributor

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.

@DTchebotarev DTchebotarev force-pushed the dmitri/add_quotes_on_sync_all_cols branch from 770c693 to d0e7d02 Compare October 26, 2023 04:34
@cla-bot
Copy link

cla-bot bot commented Oct 26, 2023

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: @DTchebotarev

@DTchebotarev
Copy link
Author

@cla-bot check

@cla-bot cla-bot bot added the cla:yes label Oct 26, 2023
@cla-bot
Copy link

cla-bot bot commented Oct 26, 2023

The cla-bot has been summoned, and re-checked this pull request!

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.31%. Comparing base (6aeebc4) to head (0f4b601).
Report is 190 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    dbt-labs/dbt-core#8914      +/-   ##
==========================================
- Coverage   86.36%   86.31%   -0.05%     
==========================================
  Files         177      177              
  Lines       26385    26385              
==========================================
- Hits        22787    22775      -12     
- Misses       3598     3610      +12     
Flag Coverage Δ
integration 83.10% <ø> (-0.11%) ⬇️
unit 64.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbeatty10 dbeatty10 added Team:Adapters Issues designated for the adapter area of the code ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering labels Oct 27, 2023
@nathaniel-may nathaniel-may added help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors and removed help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors labels Nov 22, 2023
@dbeatty10 dbeatty10 added the dbt-adapters Needs migration to the dbt-adapters repo label Feb 5, 2024
@dbeatty10 dbeatty10 added the community This PR is from a community member label Mar 22, 2024
@dbeatty10 dbeatty10 added the bug Something isn't working label Apr 10, 2024
@dbeatty10
Copy link
Contributor

Thanks for taking the time to open this PR @DTchebotarev! 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.

@dbeatty10 dbeatty10 closed this Apr 10, 2024
@dbeatty10 dbeatty10 added the quoting Issues related to dbt's quoting behavior label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla:yes community This PR is from a community member dbt-adapters Needs migration to the dbt-adapters repo quoting Issues related to dbt's quoting behavior ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering Team:Adapters Issues designated for the adapter area of the code
Projects
None yet
3 participants