Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

fix: Table name should be quoted by back quotes (`) on DROP TABLE - #385

Merged
ankiaga merged 2 commits into
mainfrom
drop_table_fix
Feb 7, 2024
Merged

fix: Table name should be quoted by back quotes (`) on DROP TABLE#385
ankiaga merged 2 commits into
mainfrom
drop_table_fix

Conversation

@ankiaga

Copy link
Copy Markdown
Contributor

indexes += "DROP INDEX {};".format(self.preparer.quote(index.name))

return indexes + constrs + str(drop_table)
return indexes + constrs + super().visit_drop_table(drop_table)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use the same strategy for quoting identifiers for all operations in this method (and probably also in the entire file). In this method, it seems that most identifiers are quoted using preparer.quote(..).

Example: "DROP INDEX {};".format(self.preparer.quote(index.name)). Should we do that here as well?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

self.preparer.quote (its a super class variable not overridden here) is the correct way as internally super().visit_drop_table() also calls self.preparer.quote

@ankiagaankiaga added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 6, 2024
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 6, 2024
@ankiaga
ankiaga merged commit 628d26c into mainFeb 7, 2024
@ankiaga
ankiaga deleted the drop_table_fix branch February 7, 2024 04:49
@release-pleaserelease-pleaseBot mentioned this pull request Feb 7, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spannerIssues related to the googleapis/python-spanner-sqlalchemy API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ankiaga@olavloite@yoshi-kokoro