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

[Bug] Updating a data type detail (e.g. size) results in a breaking change on the contract #11186

Open
2 tasks done
marvingeerken opened this issue Jan 6, 2025 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working triage

Comments

@marvingeerken
Copy link

marvingeerken commented Jan 6, 2025

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

We have a model materialized as a table with an enforced contract. If we change a column's data type from varchar(1) to varchar(2), this change is detected as a breaking change.

Expected Behavior

As described in https://docs.getdbt.com/reference/resource-configs/contract#size-precision-and-scale it should not result in a breaking change.

Steps To Reproduce

  1. Create model with a varchar column and an enforced contract.
  2. Change the varchar size on that contract and run deferring to the previous state.

Relevant log output

Command failed
Breaking change to contract Error in model md_company_code (models/marts/business_partner/bukrs/md_company_code.sql)
  While comparing to previous project state, dbt detected a breaking change to an enforced contract.
    - Columns with data_type changes: 
      - nk_company_code (varchar(120) -> varchar(121))
  Consider making an additive (non-breaking) change instead, if possible.
  Otherwise, create a new model version: https://docs.getdbt.com/docs/collaborate/govern/model-versions

Environment

dbt Cloud: Latest

Which database adapter are you using with dbt?

snowflake

Additional Context

It might be related to the following release:

@marvingeerken marvingeerken added bug Something isn't working triage labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant