From 1733bdb798d927a6d7122d8e150bf44825e168f9 Mon Sep 17 00:00:00 2001 From: Pedro Sousa Date: Mon, 8 Aug 2022 13:14:10 +0100 Subject: [PATCH] fix support for dbt v1.3 --- macros/utils.sql | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/macros/utils.sql b/macros/utils.sql index 9686c4e..7288464 100644 --- a/macros/utils.sql +++ b/macros/utils.sql @@ -13,24 +13,10 @@ {% endmacro %} {% macro render_node(node) %} - {% set sql = node.raw_sql if dbt_unit_testing.version_in_group("1.2.0") else node.raw_code %} + {% set sql = node.raw_sql if node.raw_sql is defined else node.raw_code %} {{ return (render(sql)) }} {% endmacro %} -{% macro version_in_group(version_group_identifier) %} - {% set version_groups = [["1.1.0", "1.2.0"], ["1.3.0b1"]] %} - {% set group_indexes = {"i1": -1, "i2": -1} %} - {% for version_group in version_groups %} - {% if dbt_version in version_group %} - {% do group_indexes.update({"i1": loop.index}) %} - {% endif %} - {% if version_group_identifier in version_group %} - {% do group_indexes.update({"i2": loop.index}) %} - {% endif %} - {% endfor %} - {{ return (group_indexes.i1 == group_indexes.i2) }} -{% endmacro %} - {% macro extract_columns_list(query) %} {% set results = dbt_unit_testing.run_query(query) %} {% set columns = results.columns | map(attribute='name') | list %}