dbt-synapse icon indicating copy to clipboard operation
dbt-synapse copied to clipboard

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

Open alittlesliceoftom opened this issue 1 year ago • 0 comments

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.

https://github.com/dbt-labs/dbt-core/discussions/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.

alittlesliceoftom avatar Nov 18 '24 13:11 alittlesliceoftom