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 — feat: add `reload` argument to `*Job.done()` functions by tswast · Pull Request #341 · googleapis/python-bigquery

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

Conversation

@tswast

@tswast tswast commented Oct 23, 2020

Copy link
Copy Markdown
Contributor

This enables checking the job status without making an API call.

It also fixes an inconsistency in QueryJob, where a job can be
reported as "done" without having the results of a getQueryResults API
call.

Follow-up to #340

Sorry, something went wrong.

Uh oh!

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

All reactions
@tswast
feat: add reload argument to *Job.done() functions
dbd1860
This enables checking the job status without making an API call.

It also fixes an inconsistency in `QueryJob`, where a job can be
reported as "done" without having the results of a `getQueryResults` API
call.
@tswast
tswast requested a review from a team October 23, 2020 20:04
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 23, 2020
tswast added 3 commits October 23, 2020 15:44
@tswast
Merge branch 'master' into issue339-queryjob
6768f90
@tswast
Merge branch 'master' into issue339-queryjob
22fdaf8
@tswast
Merge branch 'master' into issue339-queryjob
0dca76c
@tswast tswast mentioned this pull request Oct 27, 2020
perf: use jobs.getQueryResults to download result sets #347
Closed
4 tasks
shollyman
shollyman approved these changes Oct 27, 2020
View reviewed changes

@shollyman shollyman left a comment

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.

Do the changes here indicate there's further changes for registering the done callback? My mental model has them independent, but I wanted to make sure.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread google/cloud/bigquery/job.py
is_done = (
# Only consider a QueryJob complete when we know we have the final
# query results available.
self._query_results is not None

@shollyman shollyman Oct 27, 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.

checking: What about DDL statements, where we have no results? Or would this already retain the empty row iterator?

Sorry, something went wrong.

Uh oh!

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

All reactions

@tswast tswast Oct 28, 2020

Copy link
Copy Markdown
Contributor Author

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.

DDL statements don't 404 for jobs.getQueryResults, do they? This is the full response object of jobs.getQueryResults, not just the rows.

Sorry, something went wrong.

Uh oh!

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

All reactions
@tswast

tswast commented Oct 28, 2020

Copy link
Copy Markdown
Contributor Author

Do the changes here indicate there's further changes for registering the done callback?

No callbacks here. Maybe when we implement the async client googleapis/google-cloud-python#15742

done does get called by result via PollingFuture._blocking_poll, which is why I can now remove the extra call to _get_query_results from QueryJob.result().

All reactions

Sorry, something went wrong.

Uh oh!

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

@tswast

tswast commented Oct 28, 2020

Copy link
Copy Markdown
Contributor Author

Do the changes here indicate there's further changes for registering the done callback?

Maybe you meant -- How do we get the needed arguments to get_query_results from result? I'm planning to do something a little bit hacky in https://github.com/googleapis/python-bigquery/pull/347/files -- which maybe is a bad idea, as it means you can't call result from two threads simultaneously. Hmmm...

All reactions

Sorry, something went wrong.

Uh oh!

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

@tswast
Merge branch 'master' into issue339-queryjob
38cd8ed
@tswast tswast added the automerge Merge the pull request once unit tests and other checks pass. label Oct 28, 2020
@gcf-merge-on-green
gcf-merge-on-green Bot merged commit e51fd45 into googleapis:master Oct 28, 2020
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 28, 2020
@tswast
tswast deleted the issue339-queryjob branch November 3, 2020 20:37
@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
@shollyman shollyman shollyman 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.

Uh oh!

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

2 participants

@tswast @shollyman
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.