dbt-core
dbt-core copied to clipboard
merge exclude columns for incremental models
resolves #5260
Description
This PR allows a user to specify a list of columns not to update during an incremental run using the merge strategy. This is achieved via a new macro get_merge_update_columns
that will take into account user input from either merge_update_columns
or the new merge_exclude_columns
config to return the correct set of columns to update.
This will need to be dispatched to accomodate slightly different behavior in the dbt-spark
repository.
Checklist
- [x] I have read the contributing guide and understand what's expected of me
- [x] I have signed the CLA
- [x] 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
- [ ] I have opened an issue to add/update docs, or docs changes are not required/relevant for this PR
- [x] I have run
changie new
to create a changelog entry
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.
Thanks @dave-connors-3! I'm tagging this ready_for_review
, and adding it to the review queue for the Adapters team.
In order to merge this PR, we'll want a functional test for merge_exclude_columns
that lives in dbt-tests-adapter
, and runs successfully when pulled into dbt-snowflake
+ dbt-bigquery
+ dbt-spark
.
It would make sense for this new test to live alongside the existing tests for merge_update_columns
. Currently, those tests live only in each adapter plugin, and not yet converted to use the new pytest
framework:
hey @jtcohen6! I think we should be good to go on added tests --
I likely missed something, so let me know what else needs to be done!
Our team would love to have this feature. What is the status of this PR?
@nathaniel-may could this be a PR that you prioritize the team to get some eyes on and review please?