From fa7d70afa09c9c3ac744cc5b334af6da5e9eab3a Mon Sep 17 00:00:00 2001 From: David E Worth Date: Mon, 12 Jun 2023 14:57:33 -0600 Subject: [PATCH] include models_to_exclude in build_model_dependencies recursion This allows the dependency detection to short-circuit mocking CTEs when appropriate --- macros/sql_builders.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/sql_builders.sql b/macros/sql_builders.sql index 2f3e360..237e26b 100644 --- a/macros/sql_builders.sql +++ b/macros/sql_builders.sql @@ -59,7 +59,7 @@ {% set node = dbt_unit_testing.node_by_id(node_id) %} {% if node.unique_id not in models_to_exclude %} {% if node.resource_type in ('model','snapshot') and build_full_lineage %} - {% set child_model_dependencies = dbt_unit_testing.build_model_dependencies(node) %} + {% set child_model_dependencies = dbt_unit_testing.build_model_dependencies(node, models_to_exclude, build_full_lineage) %} {% for dependency_node_id in child_model_dependencies %} {{ model_dependencies.append(dependency_node_id) }} {% endfor %}