From 361d0f1fe62bc8bcaaba2b70fa0e5f8eeaa81aa6 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Thu, 7 Jan 2021 12:05:43 +0100 Subject: [PATCH 1/2] If conditional around get_columns_in_relation --- macros/schema_tests/equality.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/macros/schema_tests/equality.sql b/macros/schema_tests/equality.sql index ddb02461..5165ff49 100644 --- a/macros/schema_tests/equality.sql +++ b/macros/schema_tests/equality.sql @@ -13,12 +13,14 @@ If the compare_cols arg is provided, we can run this test without querying the information schema — this allows the model to be an ephemeral model -#} -{%- if not kwargs.get('compare_columns', None) -%} +{%- set compare_columns = kwargs.get('compare_columns', None) -%} + +{%- if not compare_columns -%} {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%} + {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%} {%- endif -%} {% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %} -{% set compare_columns = kwargs.get('compare_columns', adapter.get_columns_in_relation(model) | map(attribute='quoted') ) %} {% set compare_cols_csv = compare_columns | join(', ') %} with a as ( From acc42817014b48f8f7ee4c2083a3145c06dd2f88 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Thu, 7 Jan 2021 12:21:12 +0100 Subject: [PATCH 2/2] Backfill recent changelog entries --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9148587..5b7ec826 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# dbt-utils v0.6.4 + +- Fix `insert_by_period` to support `dbt v0.19.0`, with backwards compatibility for earlier versions ([#319](https://github.com/fishtown-analytics/dbt-utils/pull/319), [#320](https://github.com/fishtown-analytics/dbt-utils/pull/320)) +- Speed up CI via threads, workflows ([#315](https://github.com/fishtown-analytics/dbt-utils/pull/315), [#316](https://github.com/fishtown-analytics/dbt-utils/pull/316)) +- Fix `equality` test when used with ephemeral models + explicit column set ([#321](https://github.com/fishtown-analytics/dbt-utils/pull/321)) + +# dbt-utils v0.6.3 + +- Bump `require-dbt-version` to `[">=0.18.0", "<0.20.0"]` to support dbt v0.19.0 ([#308](https://github.com/fishtown-analytics/dbt-utils/pull/308), [#309](https://github.com/fishtown-analytics/dbt-utils/pull/309)) + +## Fixes + # dbt-utils v0.6.2 ## Fixes