You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Improve performance of QueryJob.done() method #534
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.
QueryJob.done() should return True if the job has finished or reload the job and return the correct answer.
Isn't this already the case when reload=False? (code)
Or did I misunderstand the desired behavior?
This requires moving the repeated call to jobs.getQueryResults to somewhere else in the stack of functions between QueryJob.result() and QueryJob.done()
Can you please elaborate? _get_query_results() already sits below done() in the call stack, and result() is above it?
Activity
plamut commentedon Feb 27, 2021
Isn't this already the case when
reload=False? (code)Or did I misunderstand the desired behavior?
Can you please elaborate?
_get_query_results()already sits belowdone()in the call stack, andresult()is above it?