Skip to content

Commit

Permalink
PR - lowercase except values in star() (#403)
Browse files Browse the repository at this point in the history
* PR - lowercase `except` values in star()

resolves #402

* Update test_star.sql

* Update CHANGELOG.md

* Update test_star.sql

Co-authored-by: jasnonaz <jason.ganz64@gmail.com>
  • Loading branch information
reidwil-jb and jasnonaz authored Aug 30, 2021
1 parent 1e52037 commit 5abb160
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- Declare compatibility with dbt v0.21.0, which has no breaking changes for this package ([#398](https://github.com/fishtown-analytics/dbt-utils/pull/398))

## Features

- Allow user to provide any case type when defining the `exclude` argument in `dbt_utils.star()` ([#403](https://github.com/dbt-labs/dbt-utils/pull/403))


# dbt-utils v0.7.0
## Breaking changes
Expand Down
5 changes: 1 addition & 4 deletions integration_tests/models/sql/test_star.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

-- TODO : Should the star macro use a case-insensitive comparison for the `except` field on Snowflake?

{% set exclude_field = 'FIELD_3' if target.type == 'snowflake' else 'field_3' %}
{% set exclude_field = 'field_3' %}


with data as (
Expand Down
2 changes: 1 addition & 1 deletion macros/sql/star.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

{%- for col in cols -%}

{%- if col.column not in except -%}
{%- if col.column|lower not in except|lower -%}
{% do include_cols.append(col.column) %}

{%- endif %}
Expand Down

0 comments on commit 5abb160

Please sign in to comment.