-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
union_relations
exclude
param not actually excluding
#578
Comments
Looks like this is a case sensitivity thing with Snowflake... as the following works as expected:
Need to add some |
I suspect it is beyond just Snowflake -- looks like the implementation of `` yields quoted columns that are uppercase. We'll definitely want to add an integration test that catches this unexpected bug with Integration testHere's an initial outline for an integration test:
Code examplesModel with a union using
{{ dbt_utils.union_relations(
relations=[
ref('data_union_table_1'),
ref('data_union_table_2'),
],
exclude=['name']
) }} Strip out the
select
{{ dbt_utils.star(ref("test_union_exclude_base"), except=["_dbt_source_relation"]) }}
from {{ ref("test_union_exclude_base") }} Seed the expected output:
Compare the actual output to the expected output:
- name: test_union_exclude
tests:
- dbt_utils.equality:
compare_model: ref('data_union_exclude_expected') |
Resolved by #587 |
Describe the bug
The
exclude
param in theunion_relations
function doesn't actually exclude the column from the final result.Steps to reproduce
Add to
dbt_utils
topackage.yml
and then dodbt deps
.Use
union_relations
in a model and specifyexclude
:Run or compile the model above.
Check logs or query the table to see that
status
column is not excluded as expected.Expected results
Expected that the
status
column is not added tomy_model
table.Actual results
status
column shows up inmy_model
table.Screenshots and log output
debug logs:
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:Additional context
Haven't tried to find out why this is happening yet - just reproducing.
Are you interested in contributing the fix?
Yes
The text was updated successfully, but these errors were encountered: