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

Model Contracts Warn Error - Can't (work out) how to Configure with Warn Error Options #261

Open
alittlesliceoftom opened this issue Nov 18, 2024 · 0 comments

Comments

@alittlesliceoftom
Copy link

alittlesliceoftom commented Nov 18, 2024

Context:
I want to raise all warnings as error, except the model contracts error, but it's either not possible, or I can't work out how.

dbt-labs/dbt-core#7213 specifies the origination history of this error in v1.5.

{% macro <adapter>__create_table_as(...) %}
  {% set contract_config = config.get('contract') %}
  {% if contract_config.enforced %}
     {{exceptions.warn("Model contracts cannot be enforced by <adapter>!")}}
  {% endif %}
{% endmacro %}

When I read the docs on warn error options, I find that I should specify warning options via this list:
https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/events/types.py

But I can't find any type matching the exceptions.warn.

Suspect the answer may be obvious to someone more familiar with this part of the codebase.

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

No branches or pull requests

1 participant