-
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
Fix table/schema quoting on drop, truncate, and rename (#983) #991
Conversation
dc2d453
to
99a04e9
Compare
dbt/adapters/default/impl.py
Outdated
@classmethod | ||
def _quote_policy(cls, project_cfg): | ||
quoting_cfg = project_cfg.get('quoting', {}) | ||
for quote_key in ('dtabase', 'schema', 'identifier'): |
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.
should this be database
?
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.
Yes, thank you!
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.
do we need to account for project
here too?
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.
also, I'm pretty confused about cls.DEFAULT_QUOTE
. Why would we use that instead of the default quote policy on a given Relation 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.
I didn't really realize how that worked, I've moved it to use that instead.
@beckjake looks good! I'm shocked this code change was required -- did we just never account for this? @cmcarthur do you remember if there's a reason we never implemented quoting configs here? How did it ever work?? |
Legacy adapter
drop
,truncate
, andrename
calls were not using the project quoting policy when creating relations to be passed on to their*_relation
, so they always became whatever the default was.Fixes #983