From 2f8f9580642394ff15f8bdac344833b95c68fa49 Mon Sep 17 00:00:00 2001 From: Jack DeLoach Date: Fri, 23 Jan 2015 17:57:50 -0500 Subject: [PATCH] Fix gbq client to only return results when jobCompleted is True. When polling for a long-running gbq job to determine if it is complete, we should only return results once query_results['jobCompleted'] is True, not just when the 'jobCompleted' key exists. --- pandas/io/gbq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/gbq.py b/pandas/io/gbq.py index 572a8be5c65e8..1b39bceed30ad 100644 --- a/pandas/io/gbq.py +++ b/pandas/io/gbq.py @@ -185,7 +185,7 @@ def run_query(self, query): job_reference = query_reply['jobReference'] - while(not 'jobComplete' in query_reply): + while(not 'jobComplete' in query_reply and not query_reply['jobComplete']): print('Job not yet complete...') query_reply = job_collection.getQueryResults( projectId=job_reference['projectId'],