From d30c06bd1a9ff8e2aab8006c4e4815e91fabd793 Mon Sep 17 00:00:00 2001 From: Kevin McLaughlin Date: Wed, 7 Sep 2022 11:24:12 -0500 Subject: [PATCH 1/2] fix: source_column_name none source_column_name need a [none test](https://stackoverflow.com/questions/19614027/jinja2-template-variable-if-none-object-set-a-default-value) not "!=" --- macros/sql/union.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/sql/union.sql b/macros/sql/union.sql index 13abd30d..e9a249a5 100644 --- a/macros/sql/union.sql +++ b/macros/sql/union.sql @@ -85,7 +85,7 @@ ( select - {%- if source_column_name != none %} + {%- if source_column_name is not none %} cast({{ dbt_utils.string_literal(relation) }} as {{ type_string() }}) as {{ source_column_name }}, {%- endif %} From 9dfee1ae1fda668fbbbfc2e0fa22e1bdae520215 Mon Sep 17 00:00:00 2001 From: Kevin McLaughlin Date: Wed, 7 Sep 2022 11:27:09 -0500 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6cf070a..cbcb51cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,7 @@ After: - Add Snowflake specific implementation of `deduplicate()` ([#543](https://github.com/dbt-labs/dbt-utils/issues/543), [#548](https://github.com/dbt-labs/dbt-utils/pull/548)) ## Fixes +- Fix `union_relations` `source_column_name` none option. - Enable a negative part_number for `split_part()` ([#557](https://github.com/dbt-labs/dbt-utils/issues/557), [#559](https://github.com/dbt-labs/dbt-utils/pull/559)) ## Quality of life