From 5da1990baaf870d64fb74544afbfbfe3b1fa7733 Mon Sep 17 00:00:00 2001 From: Chris Baldwin Date: Thu, 7 Mar 2024 15:26:00 +1000 Subject: [PATCH] create_view_as - Show contracts warning only when contract_config.enforced is set --- .../macros/materializations/models/view/create_view_as.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/include/synapse/macros/materializations/models/view/create_view_as.sql b/dbt/include/synapse/macros/materializations/models/view/create_view_as.sql index 7deee62e..9bdd0bb8 100644 --- a/dbt/include/synapse/macros/materializations/models/view/create_view_as.sql +++ b/dbt/include/synapse/macros/materializations/models/view/create_view_as.sql @@ -4,9 +4,9 @@ {% set contract_config = config.get('contract') %} - {{exceptions.warn("Model contracts cannot be enforced by !")}} {% if contract_config.enforced %} + {{ exceptions.warn("Model contracts cannot be enforced by !" }} {{ get_assert_columns_equivalent(sql) }} {%- endif %}