-
Notifications
You must be signed in to change notification settings - Fork 510
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
Adds 3 parameters to unpivot: remove, field_name, value_name #142
Conversation
@drewbanin check this out, it's my first DBT contribution :-D |
Hey @remigabillet - thanks for the heads up! I'll give this a look today (cc @dwallace0723, the original author of this macro 😉) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @remigabillet! This is looking really good! Some comments below, and one test failure, but I think this is super close.
Database Error in model test_unpivot_original_api (models/sql/test_unpivot_original_api.sql)
000904 (42000): 018cf03d-0377-c5e3-0000-0e6902c5023a: SQL compilation error: error line 19 at position 50
invalid identifier 'FIELD_NAME'
compiled SQL at target/compiled/dbt_utils_integration_tests/sql/test_unpivot_original_api.sql
96ae631
to
178900e
Compare
Cool! Just kicked off a build :) I think we'll be good to merge this when the tests pass! |
f67310e
to
a0c1ac7
Compare
hey @drewbanin it still doesn't work. Sorry to keep bothering you. I'm happy to iterate on it but I don't have snowflake so I need the CI to run automatically. Is there a way for me to do that? |
Hey @remigabillet - we disabled builds on PRs to prevent nefarious users from logging out our database credentials! We've permissioned everything accordingly, but we still review PRs before we kick off CI builds. Would love to figure out a setup (dedicated redshift+snowflake+bq instances) that would let us make this CI process more friendly for contributors though. Not sure if you saw my comment above, but i think all you need to do to get these tests to pass is lowercase the
Once you make that change I can kick off the CI build and get this thing merged! This is also super minor, lmk if you'd prefer for me to make that particular change. |
Got it re: CI. I actually wrote the test a little differently, removing that conditional. Isn't it the same thing?
|
I'm still unclear on snowflake's casing, do I need to add conditional around the |
The conditional really just needs to be applied to
but I like the idea of making it explicit that Snowflake is the odd one out here. |
Thanks for the explanation @drewbanin. I think I get it now, Snowflake uppercases column names so I need to lowercase before I compare my test output with the expected results. |
cool! This last change LGTM - looks like there's just a tiny typo where you project the column as |
ff49777
to
1ec2dd1
Compare
thanks @remigabillet, merging! |
Yes ! |
This makes
dbt_utils.unpivot
a bit more likepandas.melt
by adding the ability :