From 5717b109d358844e0f085565b93e74cbe469ecb0 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Thu, 3 Mar 2022 14:24:19 +1300 Subject: [PATCH] Fix union_relations error when no include/exclude provided * Fix union_relations error when no include/exclude provided (#509) * Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ macros/sql/union.sql | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67b690e7..f346c55b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# dbt-utils v0.8.2 +## Fixes +- Fix union_relations error from [#473](https://github.com/dbt-labs/dbt-utils/pull/473) when no include/exclude parameters are provided ([#505](https://github.com/dbt-labs/dbt-utils/issues/505), [#509](https://github.com/dbt-labs/dbt-utils/pull/509)) + # dbt-utils v0.8.1 ## New features diff --git a/macros/sql/union.sql b/macros/sql/union.sql index 009a765a..a7bf1d95 100644 --- a/macros/sql/union.sql +++ b/macros/sql/union.sql @@ -61,7 +61,7 @@ {%- set ordered_column_names = column_superset.keys() -%} - {%- if not column_superset.keys() -%} + {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %} {%- set relations_string -%} {%- for relation in relations -%} {{ relation.name }}