From 3deecdea64c4b10cb15b2c54118e6bd65ee48c55 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Mon, 19 Feb 2024 11:39:40 -0500 Subject: [PATCH] Readd removed logic for deferral fail-over (#94) --- .../global_project/macros/unit_test_sql/get_fixture_sql.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt/include/global_project/macros/unit_test_sql/get_fixture_sql.sql b/dbt/include/global_project/macros/unit_test_sql/get_fixture_sql.sql index ba35fab2..f63aaa79 100644 --- a/dbt/include/global_project/macros/unit_test_sql/get_fixture_sql.sql +++ b/dbt/include/global_project/macros/unit_test_sql/get_fixture_sql.sql @@ -3,7 +3,7 @@ {% set default_row = {} %} {%- if not column_name_to_data_types -%} -{%- set columns_in_relation = adapter.get_columns_in_relation(this) -%} +{%- set columns_in_relation = adapter.get_columns_in_relation(load_relation(this) or defer_relation) -%} {%- set column_name_to_data_types = {} -%} {%- for column in columns_in_relation -%} {#-- This needs to be a case-insensitive comparison --#} @@ -44,7 +44,7 @@ union all {% macro get_expected_sql(rows, column_name_to_data_types) %} {%- if (rows | length) == 0 -%} - select * FROM dbt_internal_unit_test_actual + select * from dbt_internal_unit_test_actual limit 0 {%- else -%} {%- for row in rows -%}