-
Notifications
You must be signed in to change notification settings - Fork 298
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(dbapi): avoid running % format with no query parameters #348
Conversation
tests/unit/test_dbapi_cursor.py
Outdated
def test__format_operation_w_empty_dict(self): | ||
from google.cloud.bigquery.dbapi import cursor | ||
|
||
formatted_operation = cursor._format_operation("SELECT 1", {},) |
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.
Won't the linter complain about the trailing comma here?
tests/unit/test_dbapi_cursor.py
Outdated
from google.cloud.bigquery.dbapi import cursor | ||
|
||
formatted_operation = cursor._format_operation("SELECT 1", {}) | ||
self.assertEqual(formatted_operation, "SELECT 1") |
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.
Actually, let's put a %
sign in this string to catch the reported error
self.assertEqual(formatted_operation, "SELECT 1") | |
self.assertEqual(formatted_operation, "SELECT '%f'") |
…into bigquery_issue_346
Thanks for the quick fix! |
Fixes #346