Skip to content

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

Open
@marvingeerken

Description

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:

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcloudIssues related to dbt Cloudtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions