Skip to content
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

Merged
merged 6 commits into from
Sep 13, 2018

Conversation

beckjake
Copy link
Contributor

Legacy adapter drop, truncate, and rename 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

@classmethod
def _quote_policy(cls, project_cfg):
quoting_cfg = project_cfg.get('quoting', {})
for quote_key in ('dtabase', 'schema', 'identifier'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be database?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thank you!

Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@drewbanin
Copy link
Contributor

@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??

@beckjake beckjake merged commit 16fa082 into dev/lucretia-mott Sep 13, 2018
@beckjake beckjake deleted the fix/drop-table-quoting branch September 13, 2018 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants