-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 for versioned models #11186
Comments
@marvingeerken Thanks for the report here! Can you please provide some more context about the model, such as whether it is an incremental model? I'm not able to replicate this issue for a non-incremental model on my end. Thanks! |
@aranke Thanks for your feedback. It was a My test was on my own dbt Cloud account. If I face the issue again on my clients projects, I would ping you again. IMO we can close it. |
Great, closing the issue for now. |
Hey @aranke! I have identified why I wasn't able to recreate the error outside my clients project. On my test I haven't had a model version added. Can you please investigate again? (I have no permission to reopen the issue. Hope this message finds you well.) |
I wondered whether I could add a similar scenario to this issue. I have updated the data type of a column but only it's case (i.e. decimal(6,5) to DECIMAL(6,5)) and this was treated as a breaking change. I also noticed that if I added a space after the comma within the data type, this would also result in a breaking change error. Since this change would not actually cause any breakage in the model, tests or downstream usage, I don't think these types of changes, as well as the initial issue, should be treated as a breaking change. |
@liamfmck95 could you open this as a new feature idea? It's a reasonable point but slightly different from this |
Thanks @joellabes , I have added this now #11352 |
Is this a new bug in dbt-core?
Current Behavior
We have a model materialized as a table with an enforced contract and a version 1. If we change a column's data type from
varchar(1)
tovarchar(2)
, this change is detected as a breaking change.We already identified that it only happens when a version is added. The materialization does not matter.
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
Deploy to staging/production deployment environment.
Change the varchar size on that contract and run deferring to the previous state.
data_type: varchar(3)
-->data_type: varchar(4)
Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
It might be related to the following release:
The text was updated successfully, but these errors were encountered: