diff --git a/CHANGELOG.md b/CHANGELOG.md index 48df29bb..4a7ef4f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/integration_tests/models/sql/test_star.sql b/integration_tests/models/sql/test_star.sql index 3c1af078..2092e16a 100644 --- a/integration_tests/models/sql/test_star.sql +++ b/integration_tests/models/sql/test_star.sql @@ -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 ( diff --git a/macros/sql/star.sql b/macros/sql/star.sql index 8f82f3ae..b55054de 100644 --- a/macros/sql/star.sql +++ b/macros/sql/star.sql @@ -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 %}