dbt-core icon indicating copy to clipboard operation
dbt-core copied to clipboard

merge exclude columns for incremental models

Open dave-connors-3 opened this issue 2 years ago • 5 comments

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

dave-connors-3 avatar Jul 11 '22 18:07 dave-connors-3

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.

github-actions[bot] avatar Jul 11 '22 18:07 github-actions[bot]

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:

jtcohen6 avatar Jul 18 '22 10:07 jtcohen6

hey @jtcohen6! I think we should be good to go on added tests --

Spark BQ Snowflake

I likely missed something, so let me know what else needs to be done!

dave-connors-3 avatar Jul 20 '22 18:07 dave-connors-3

Our team would love to have this feature. What is the status of this PR?

kd2718 avatar Aug 24 '22 18:08 kd2718

@nathaniel-may could this be a PR that you prioritize the team to get some eyes on and review please?

leahwicz avatar Aug 25 '22 17:08 leahwicz