Skip to content

Commit 3039533

Browse files
aarontjreback
authored andcommitted
BUG: The 'jobComplete' key may be present but False in the query results.
Fixes an error when looking for 'totalRows' on a large dataset which is not finished in between two subsequent checks. DOC: Added line to what's new for an bug in the BigQuery reader (GH8728)
1 parent 4a70ba9 commit 3039533

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

doc/source/whatsnew/v0.16.0.txt

+2
Original file line numberDiff line numberDiff line change
@@ -530,3 +530,5 @@ Bug Fixes
530530

531531

532532
- Fixed bug with reading CSV files from Amazon S3 on python 3 raising a TypeError (:issue:`9452`)
533+
534+
- Bug in the Google BigQuery reader where the 'jobComplete' key may be present but False in the query results (:issue:`8728`)

pandas/io/gbq.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def run_query(self, query):
201201

202202
job_reference = query_reply['jobReference']
203203

204-
while(not 'jobComplete' in query_reply):
204+
while(not query_reply.get('jobComplete', False)):
205205
print('Job not yet complete...')
206206
query_reply = job_collection.getQueryResults(
207207
projectId=job_reference['projectId'],

0 commit comments

Comments
 (0)