Skip to content

Commit

Permalink
Fixed fewer_rows_than and equal_rowcount macros to work with warehous…
Browse files Browse the repository at this point in the history
…es which do not support lateral column aliasing
  • Loading branch information
damian3031 committed Dec 15, 2022
1 parent 42003d7 commit dd1bbb8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<!--- Copy, paste, and uncomment the following headers as-needed for unreleased features
# Unreleased
## New features
- XXX ([#XXX](https://github.com/dbt-labs/dbt-utils/issues/XXX), [#XXX](https://github.com/dbt-labs/dbt-utils/pull/XXX))
## Fixes
## Quality of life
## Under the hood
## Contributors:
--->
- Fixed fewer_rows_than and equal_rowcount macros to work with warehouses which do not support lateral column aliasing ([#744](https://github.com/dbt-labs/dbt-utils/issues/744), [#746](https://github.com/dbt-labs/dbt-utils/pull/746))
## Contributors: @damian3031


# dbt utils v1.0

Expand Down
2 changes: 1 addition & 1 deletion macros/generic_tests/equal_rowcount.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}
{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}
{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}
{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}
{% set groupby_gb_cols = dbt_utils.group_by(group_by_columns|length) %}

with a as (

Expand Down
2 changes: 1 addition & 1 deletion macros/generic_tests/fewer_rows_than.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}
{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}
{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}
{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}
{% set groupby_gb_cols = dbt_utils.group_by(group_by_columns|length) %}


with a as (
Expand Down

0 comments on commit dd1bbb8

Please sign in to comment.