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 2f90a561..5c4c5005 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}) -%}