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

Incremental models with a contract don't need their columns modified #10371

Merged
merged 6 commits into from
Aug 14, 2024

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Jun 26, 2024

resolves #10362

Problem

Incremental models with existing tables had their columns updated by "expand_target_column_types", but this is unnecessary when models have a contract.

Solution

Do not call "expand_target_column_types" when an incremental model has an enforced contract.

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

@gshank gshank requested a review from a team as a code owner June 26, 2024 20:57
@cla-bot cla-bot bot added the cla:yes label Jun 26, 2024
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.

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.83%. Comparing base (25c2042) to head (abd2274).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10371   +/-   ##
=======================================
  Coverage   88.83%   88.83%           
=======================================
  Files         180      180           
  Lines       22704    22704           
=======================================
  Hits        20169    20169           
  Misses       2535     2535           
Flag Coverage Δ
integration 86.06% <ø> (ø)
unit 62.24% <ø> (ø)

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

Components Coverage Δ
Unit Tests 62.24% <ø> (ø)
Integration Tests 86.06% <ø> (ø)

Copy link
Contributor

@mikealfare mikealfare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, conditional on reverting the feature branch reference in dev-requirements.txt.

@@ -1,4 +1,4 @@
git+https://github.com/dbt-labs/dbt-adapters.git@main
git+https://github.com/dbt-labs/dbt-adapters.git@incremental_contract_varchar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to revert this prior to merging.

@gshank gshank merged commit 5f66678 into main Aug 14, 2024
63 checks passed
@gshank gshank deleted the incremental_contract_varchar branch August 14, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Incorrect column data type with incremental contracted model and varchar data_type
2 participants