GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(dbapi): avoid running % format with no query parameters by HemangChothani · Pull Request #348 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@HemangChothani

@HemangChothani HemangChothani commented Oct 28, 2020

Copy link
Copy Markdown
Contributor

Fixes #346

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HemangChothani
fix: aviod running %format when no query params
9b493db
@HemangChothani
HemangChothani requested review from a team and tswast October 28, 2020 08:43
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 28, 2020
tswast
tswast reviewed Oct 28, 2020
View reviewed changes
Comment thread 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", {},)

@tswast tswast Oct 28, 2020

Copy link
Copy Markdown
Contributor

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HemangChothani
fix: nit
b881e6c
tswast
tswast approved these changes Oct 28, 2020
View reviewed changes
tswast
tswast suggested changes Oct 28, 2020
View reviewed changes
Comment thread 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")

@tswast tswast Oct 28, 2020

Copy link
Copy Markdown
Contributor

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

Suggested change
self.assertEqual(formatted_operation, "SELECT 1")
self.assertEqual(formatted_operation, "SELECT '%f'")

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
HemangChothani added 2 commits October 29, 2020 10:36
@HemangChothani
Merge branch 'master' of https://github.com/googleapis/python-bigquery …
86b311e
…into bigquery_issue_346
@HemangChothani
fix: change in unit test
2a336d6
tswast
tswast approved these changes Oct 29, 2020
View reviewed changes
@tswast tswast changed the title fix: aviod running %format when no query params fix(dbapi): avoid running % format with no query parameters Oct 29, 2020
@tswast
tswast merged commit 5dd1a5e into googleapis:master Oct 29, 2020
@tswast

tswast commented Oct 29, 2020

Copy link
Copy Markdown
Contributor

Thanks for the quick fix!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@release-please release-please Bot mentioned this pull request Jan 4, 2022
chore(main): release python-bigquery 1.27.1 #1097
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@tswast tswast tswast approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

fix(dbapi): avoid running % format when no query parameters are passed

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@HemangChothani @tswast
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.