Skip to content

Commit

Permalink
fix: source_column_name none (dbt-labs#661)
Browse files Browse the repository at this point in the history
* 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 "!="

* Update CHANGELOG.md
  • Loading branch information
kmclaugh authored Sep 7, 2022
1 parent cd56410 commit a77aebf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion macros/sql/union.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down

0 comments on commit a77aebf

Please sign in to comment.