From b1069a545d5db8987a48ded880d3d28ca88ee335 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Wed, 31 Jan 2024 13:43:48 +0100 Subject: [PATCH] Use defer_relation for unit test type detection if available --- .../global_project/macros/unit_test_sql/get_fixture_sql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2f90a561d..5c4c50055 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(defer_relation or this) -%} {%- set column_name_to_data_types = {} -%} {%- for column in columns_in_relation -%} {%- do column_name_to_data_types.update({column.name: column.dtype}) -%}