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

[Feature] Support passing a flag to suppress errors arising from removing a versioned, contracted model #11290

Open
3 tasks done
ramiz-bozai-dbt opened this issue Feb 10, 2025 · 1 comment

Comments

@ramiz-bozai-dbt
Copy link

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

With changes made in dbt v1.9, removing a contracted model that is also versioned raises an error. This causes issues in a use case where I would like to put out a "pre-release" and make changes prior to making this available for public consumption.

In an ideal situation, there could be two paths forward:

  1. dbt raises a warning instead of an error when it sees a breaking change to a versioned, contracted model and the version is greater than the model's existing latest_version
  2. (even better) if we're interested in enforcing this, there could be an option for users to pass a flag such as bypass_prerelease_warnings to allow for users to work around this.

Describe alternatives you've considered

The simplest alternative is to either remove the model versioning which allows this to become a warning. Alternatively, you can remove the model altogether then create a new release to add it back. Neither option is particularly conducive to shipping fast.

Who will this benefit?

Teams looking to "pre-release" models which are not ready for public consumption just yet.

Are you interested in contributing this feature?

N/A

Anything else?

No response

@ramiz-bozai-dbt ramiz-bozai-dbt added enhancement New feature or request triage labels Feb 10, 2025
@jtcohen6
Copy link
Contributor

@ramiz-bozai-dbt Thanks for opening!

dbt raises a warning instead of an error when it sees a breaking change to a versioned, contracted model and the version is greater than the model's existing latest_version

I like this idea :) I think it'd be reasonable to turn on for everyone by default. In my opinion - "prerelease" means the interface isn't stable & committed yet. While it's not something to take lightly, software maintainer still has the right to make backwards-incompatible changes. [SemVer says](A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version.):

A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version.

(even better) if we're interested in enforcing this, there could be an option for users to pass a flag such as bypass_prerelease_warnings to allow for users to work around this.

If we add this as a specific new warning with a strongly typed name, users already have solid flexibility for silencing or promoting to error. See warn_error_options here: https://docs.getdbt.com/reference/global-configs/warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants