From 72c17c446440afe7d4b6501ed364effe8e14c9f2 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Wed, 11 May 2022 16:48:25 +0200 Subject: [PATCH] Fix: use adapter.get_columns_in_relation (#5232) --- .changes/unreleased/Fixes-20220511-123238.yaml | 7 +++++++ .../macros/materializations/snapshots/strategies.sql | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20220511-123238.yaml diff --git a/.changes/unreleased/Fixes-20220511-123238.yaml b/.changes/unreleased/Fixes-20220511-123238.yaml new file mode 100644 index 00000000000..4b8b60c0311 --- /dev/null +++ b/.changes/unreleased/Fixes-20220511-123238.yaml @@ -0,0 +1,7 @@ +kind: Fixes +body: Fix column comparison in snapshot_check_all_get_existing_columns to use adapter.get_columns_in_relation +time: 2022-05-11T12:32:38.313321+02:00 +custom: + Author: jtcohen6 + Issue: "5222" + PR: "5232" diff --git a/core/dbt/include/global_project/macros/materializations/snapshots/strategies.sql b/core/dbt/include/global_project/macros/materializations/snapshots/strategies.sql index d2dc9e2f83f..43779b05bf6 100644 --- a/core/dbt/include/global_project/macros/materializations/snapshots/strategies.sql +++ b/core/dbt/include/global_project/macros/materializations/snapshots/strategies.sql @@ -126,7 +126,7 @@ {% do exceptions.raise_compiler_error("Invalid value for 'check_cols': " ~ check_cols_config) %} {% endif %} - {%- set existing_cols = get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%} + {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%} {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#} {%- set ns.column_added = false -%}