Skip to content

Improve performance of QueryJob.done() method #534

Closed
@tswast

Description

@tswast

Is your feature request related to a problem? Please describe.

As reported in internal issue 180972119, with a name like done(), I would expect it to be a very lightweight call. At most, I'd expect it to refresh the job state. It is not a lightweight call. It calls the jobs.getQueryResults REST API, which can hang for 10 seconds or more.

Describe the solution you'd like

QueryJob.done() should return True if the job has finished or reload the job and return the correct answer.

This requires moving the repeated call to jobs.getQueryResults to somewhere else in the stack of functions between QueryJob.result() and QueryJob.done().

Describe alternatives you've considered

Perhaps a flag to "go fast" to done()? This feels like it's making the developer interface unnecessarily complicated, though.

Additional context

Related to customer support case 26956233

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions