Skip to content

Commit

Permalink
ENH: BQ Job Id in verbose output
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Chromiec committed Jul 10, 2017
1 parent dd53b5c commit f8c6a24
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pandas_gbq/gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def run_query(self, query, **kwargs):
self._print('Requesting query... ', end="")
query_reply = job_collection.insert(
projectId=self.project_id, body=job_data).execute()
self._print('ok.\nQuery running...')
self._print('ok.')
except (RefreshError, ValueError):
if self.private_key:
raise AccessDenied(
Expand All @@ -527,13 +527,15 @@ def run_query(self, query, **kwargs):
self.process_http_error(ex)

job_reference = query_reply['jobReference']
job_id = job_reference['jobId']
self._print('Job ID: %s\nQuery running...' % job_id)

while not query_reply.get('jobComplete', False):
self.print_elapsed_seconds(' Elapsed', 's. Waiting...')
try:
query_reply = job_collection.getQueryResults(
projectId=job_reference['projectId'],
jobId=job_reference['jobId']).execute()
jobId=job_id).execute()
except HttpError as ex:
self.process_http_error(ex)

Expand Down Expand Up @@ -584,7 +586,7 @@ def run_query(self, query, **kwargs):
try:
query_reply = job_collection.getQueryResults(
projectId=job_reference['projectId'],
jobId=job_reference['jobId'],
jobId=job_id,
pageToken=page_token).execute()
except HttpError as ex:
self.process_http_error(ex)
Expand Down

0 comments on commit f8c6a24

Please sign in to comment.