Skip to content

Commit 3a55c30

Browse files
authored
Merge pull request #321 from fishtown-analytics/fix/equality-ephemeral-col-subset
Fix equality test with ephemeral model + explicit column set
2 parents 3d47bdc + acc4281 commit 3a55c30

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# dbt-utils v0.6.4
2+
3+
- 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))
4+
- 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))
5+
- Fix `equality` test when used with ephemeral models + explicit column set ([#321](https://github.com/fishtown-analytics/dbt-utils/pull/321))
6+
7+
# dbt-utils v0.6.3
8+
9+
- 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))
10+
11+
## Fixes
12+
113
# dbt-utils v0.6.2
214

315
## Fixes

macros/schema_tests/equality.sql

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
If the compare_cols arg is provided, we can run this test without querying the
1414
information schema — this allows the model to be an ephemeral model
1515
-#}
16-
{%- if not kwargs.get('compare_columns', None) -%}
16+
{%- set compare_columns = kwargs.get('compare_columns', None) -%}
17+
18+
{%- if not compare_columns -%}
1719
{%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}
20+
{%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}
1821
{%- endif -%}
1922

2023
{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}
21-
{% set compare_columns = kwargs.get('compare_columns', adapter.get_columns_in_relation(model) | map(attribute='quoted') ) %}
2224
{% set compare_cols_csv = compare_columns | join(', ') %}
2325

2426
with a as (

0 commit comments

Comments
 (0)