Skip to content

Commit 7cfeb17

Browse files
authored
ENH: BQ Job Id in verbose output (#70)
* ENH: BQ Job Id in verbose output * changelog entry
1 parent 3c2d236 commit 7cfeb17

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/pandas-gbq/docs/source/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Changelog
77
- Drop support for Python 3.4 (:issue:`40`)
88
- The dataframe passed to ```.to_gbq(...., if_exists='append')``` needs to contain only a subset of the fields in the BigQuery schema. (:issue:`24`)
99
- Use the `google-auth <https://google-auth.readthedocs.io/en/latest/>`__ library for authentication because oauth2client is deprecated. (:issue:`39`)
10-
- ``read_gbq`` now has a ``auth_local_webserver`` boolean argument for controlling whether to use web server or console flow when getting user credentials. Replaces `--noauth_local_webserver` command line argument (:issue:`35`)
10+
- ``read_gbq`` now has a ``auth_local_webserver`` boolean argument for controlling whether to use web server or console flow when getting user credentials. Replaces `--noauth_local_webserver` command line argument. (:issue:`35`)
11+
- ``read_gbq`` now displays the BigQuery Job ID in verbose output. (:issue:`70`)
1112

1213
0.1.6 / 2017-05-03
1314
------------------

packages/pandas-gbq/pandas_gbq/gbq.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def run_query(self, query, **kwargs):
514514
self._print('Requesting query... ', end="")
515515
query_reply = job_collection.insert(
516516
projectId=self.project_id, body=job_data).execute()
517-
self._print('ok.\nQuery running...')
517+
self._print('ok.')
518518
except (RefreshError, ValueError):
519519
if self.private_key:
520520
raise AccessDenied(
@@ -527,13 +527,15 @@ def run_query(self, query, **kwargs):
527527
self.process_http_error(ex)
528528

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

531533
while not query_reply.get('jobComplete', False):
532534
self.print_elapsed_seconds(' Elapsed', 's. Waiting...')
533535
try:
534536
query_reply = job_collection.getQueryResults(
535537
projectId=job_reference['projectId'],
536-
jobId=job_reference['jobId']).execute()
538+
jobId=job_id).execute()
537539
except HttpError as ex:
538540
self.process_http_error(ex)
539541

@@ -584,7 +586,7 @@ def run_query(self, query, **kwargs):
584586
try:
585587
query_reply = job_collection.getQueryResults(
586588
projectId=job_reference['projectId'],
587-
jobId=job_reference['jobId'],
589+
jobId=job_id,
588590
pageToken=page_token).execute()
589591
except HttpError as ex:
590592
self.process_http_error(ex)

0 commit comments

Comments
 (0)