-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
flip around generate_alias_name args, add node to generate_schema_name args #1483
Conversation
8598a50
to
68782b7
Compare
00559fd
to
1278662
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.
One question and a warning update, but this otherwise works great and LGTM!
core/dbt/parser/base.py
Outdated
) | ||
if too_many_args not in str(exc): | ||
raise | ||
msg = ('The generate_schema_name macro does not accept a second ' |
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.
Can you change this to
As of dbt v0.14.0, the `generate_schema_name` macro accepts a second "node" argument.
The one-argument form of `generate_schema_name` is deprecated, and will become
unsupported in a future release.
For more information, see: https://docs.getdbt.com/v0.14/docs/upgrading-to-014
What's the benefit of rolling this as a warning (with repeat=False
) over using a new Deprecation class?
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.
Honestly, I had completely forgotten about the existence of deprecations somehow. I guess I haven't had to think about them in a while...
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.
Super nitpicky feedback on the deprecation warning. It should read like:
Deprecation Warning: As of dbt v0.14.0, the `generate_schema_name` macro
accepts a second "node" argument. The one-argument form of `generate_schema_name`
is deprecated, and will become unsupported in a future release.
Merge once that's updated!
Fix many tests Support single-arg generate_schema_name macros Add repeat flag to warn_or_error to suppress duplicate warnings Add a warning if a user's macro does not take a second argument
5ee8858
to
28dc10e
Compare
Add a
node
argument to thegenerate_schema_name
macro, and makes thegenerate_alias_name
macro compatible with that change.Fixes #1483
Fixes #1463
It would be good to slip this in before people go out and build their own
generate_alias_name
macros!