From 086559c105b08263d01e93704c707bc06bea59b2 Mon Sep 17 00:00:00 2001 From: Wouter Date: Thu, 24 Aug 2023 11:54:57 +0200 Subject: [PATCH] Whitespace --- macros/tests.sql | 12 ++++++------ macros/utils.sql | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/macros/tests.sql b/macros/tests.sql index ac56896..7547684 100644 --- a/macros/tests.sql +++ b/macros/tests.sql @@ -11,8 +11,8 @@ {% if not test_report.succeeded %} {{ dbt_unit_testing.show_test_report(test_configuration, test_report) }} {% endif %} - - select 1 as a from (select 1) as t where {{ not test_report.succeeded }} + + select 1 as a from (select 1) as t where {{ not test_report.succeeded }} {{ dbt_unit_testing.clear_test_context() }} {% endif %} {% endmacro %} @@ -20,15 +20,15 @@ {% macro build_configuration_and_test_queries(model_node, test_description, options, mocks_and_expectations_json_str) %} {{ dbt_unit_testing.set_test_context("model_being_tested", dbt_unit_testing.ref_cte_name(model_node)) }} {% set test_configuration = { - "model_name": model_node.model_name, - "description": test_description, + "model_name": model_node.model_name, + "description": test_description, "model_node": model_node, - "options": dbt_unit_testing.merge_configs([options])} + "options": dbt_unit_testing.merge_configs([options])} %} {{ dbt_unit_testing.set_test_context("options", test_configuration.options) }} {{ dbt_unit_testing.verbose("CONFIG: " ~ test_configuration) }} - + {% do test_configuration.update (dbt_unit_testing.build_mocks_and_expectations(test_configuration, mocks_and_expectations_json_str)) %} {% set test_queries = dbt_unit_testing.build_test_queries(test_configuration) %} diff --git a/macros/utils.sql b/macros/utils.sql index 90a277b..f23369c 100644 --- a/macros/utils.sql +++ b/macros/utils.sql @@ -67,10 +67,10 @@ {% endmacro %} {% macro model_node (node) %} - {% set graph_nodes = graph.nodes.values() | - selectattr('resource_type', 'in', ['model', 'snapshot', 'seed']) | - selectattr('package_name', 'equalto', node.package_name) | - selectattr('name', 'equalto', node.name) | + {% set graph_nodes = graph.nodes.values() | + selectattr('resource_type', 'in', ['model', 'snapshot', 'seed']) | + selectattr('package_name', 'equalto', node.package_name) | + selectattr('name', 'equalto', node.name) | list %} {% if graph_nodes | length > 0 %} {% if node.version is defined and node.version is not none %}