From a0dbf31cded18a479981de6e22f08087149ee968 Mon Sep 17 00:00:00 2001 From: Dan Flippo Date: Fri, 26 Jul 2024 13:30:34 -0400 Subject: [PATCH] Need to exclude dynamic tables from constraints --- macros/create_constraints.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/create_constraints.sql b/macros/create_constraints.sql index 674cf94..528c4b7 100644 --- a/macros/create_constraints.sql +++ b/macros/create_constraints.sql @@ -300,7 +300,7 @@ {#- Find the table models that are referenced by this test. -#} {%- for table_node in test_model.depends_on.nodes -%} {%- for node in graph.nodes.values() | selectattr("unique_id", "equalto", table_node) - if node.config.get("materialized", "other") not in ("view", "ephemeral") + if node.config.get("materialized", "other") not in ("view", "ephemeral", "dynamic_table") and ( node.resource_type in ("model", "snapshot", "seed") or ( node.resource_type == "source" and var('dbt_constraints_sources_enabled', false) and ( ( var('dbt_constraints_sources_pk_enabled', false) and test_name in("primary_key") )