Description
(1) When I run a long, non-cached, sync query --
query_job = bq_client.run_sync_query(query_string)
query_job.run()
... it often returns without being complete. I call query_job.fetch_data(page_token=None)
to try and get the result. If the query finished by that time -- all is well, however if doesn't, the server response doesn't include the job's name (jobReference.jobId
); since the state is being completely erased/rewritten, following calls to fetch_data
fail with ValueError("Query not yet executed: call 'run()'")
.
(2) The run
method checks if self._job is not None:
to prevent a double invocation. It should however run that check with self.job
instead (no underscore), as self._job
is only set if you previously used self.job
.
(3) It would be 'nicer' if the total_rows property return an integer (or None) rather than a string.