-
Notifications
You must be signed in to change notification settings - Fork 522
Replace references to tables to relations. Add include param to union #178
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
Conversation
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.
Big fan of these changes! I like the pattern you've laid out here for refactoring + renaming macros. I read through the diffs, though I haven't tested locally. The unpivot
conditional logic to accept table
as a keyword argument is clever/thorny, but it makes sense to me as code that we'll pull (along with the warning) in a future minor release.
97d9f21
to
e3a7de8
Compare
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.
Just a couple of comments around the updated (really good) documentation here. I really like the approach you used to support either relation
or table
for some of these macros. FYI, we'll have the ability to raise proper warnings in dbt v0.15.1. Those escalate to errors if dbt is run with --warn-error
. dbt-labs/dbt-core#1977
I didn't test any of these changed macros out, but I can do that if it would be helpful. All of the code here looks very good to me! Nice work on this one :)
Yeah I saw that PR from Jake -- my mind was 🤯at how few lines of code were involved to implement that! I'll set a reminder to myself to change this later :) |
Fixes #90
Started off by adding an
include
parameter tounion
. But then when I was updating the docs I decided that having this macro namedunion_tables
is silly so did some work to tidy that up. And then I did the same forget_tables_by_prefix
andunpivot
. Pretty happy with this pattern!(This is probably the way we should have done this when we upgraded to 0.14.0, but ah well! This provides us a path to deprecate some macros though!)
I also tidied up some docs along the way.
Deprecating the
get_tables_by_prefix
andunion_tables
macros:Here's what happens when you use the old macros:
These warnings don't show up when you use the
relation
versions of these macros:Replacing the
table
arg withrelation
inunpivot
:This one was a little tricker to implement, but it works! LMK if you want me to go through this.