Skip to content

Commit 41a5d22

Browse files
author
tworec
committed
ENH: gbq docs update
1 parent 0813a33 commit 41a5d22

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

doc/source/io.rst

+9-8
Original file line numberDiff line numberDiff line change
@@ -4153,7 +4153,7 @@ to existing tables.
41534153
.. warning::
41544154

41554155
To use this module, you will need a valid BigQuery account. Refer to the
4156-
`BigQuery Documentation <https://developers.google.com/bigquery/>`__ for details on the service itself.
4156+
`BigQuery Documentation <https://cloud.google.com/bigquery/what-is-bigquery>`__ for details on the service itself.
41574157

41584158
The key functions are:
41594159

@@ -4173,17 +4173,18 @@ The key functions are:
41734173

41744174
Authentication
41754175
''''''''''''''
4176-
4177-
Authentication is possible with either user account credentials or service account credentials.
4176+
Authentication to the Google ``BigQuery`` service is via ``OAuth 2.0``.
4177+
Is possible to authenticate with either user account credentials or service account credentials.
41784178

41794179
Authenticating with user account credentials is as simple as following the prompts in a browser window
41804180
which will be automatically opened for you. You will be authenticated to the specified
4181-
``BigQuery`` account via Google's ``Oauth2`` mechanism. Additional information on the
4182-
authentication mechanism can be found `here <https://developers.google.com/identity/protocols/OAuth2#clientside/>`__.
4181+
``BigQuery`` account using the product name ``pandas GBQ``. It is only possible on local host.
4182+
The remote authentication using user account credentials is not currently supported in Pandas.
4183+
Additional information on the authentication mechanism can be found
4184+
`here <https://developers.google.com/identity/protocols/OAuth2#clientside/>`__.
41834185

41844186
Authentication with service account credentials is possible via the `'private_key'` parameter. This method
41854187
is particularly useful when working on remote servers (eg. jupyter iPython notebook on remote host).
4186-
The remote authentication using user account credentials is not currently supported in Pandas.
41874188
Additional information on service accounts can be found
41884189
`here <https://developers.google.com/identity/protocols/OAuth2#serviceaccount>`__.
41894190

@@ -4314,13 +4315,13 @@ For example:
43144315
.. note::
43154316

43164317
The BigQuery SQL query language has some oddities, see the
4317-
`BigQuery Query Reference Documentation <https://developers.google.com/bigquery/query-reference>`__.
4318+
`BigQuery Query Reference Documentation <https://cloud.google.com/bigquery/query-reference>`__.
43184319

43194320
.. note::
43204321

43214322
While BigQuery uses SQL-like syntax, it has some important differences from traditional
43224323
databases both in functionality, API limitations (size and quantity of queries or uploads),
4323-
and how Google charges for use of the service. You should refer to `Google BigQuery documentation <https://developers.google.com/bigquery/>`__
4324+
and how Google charges for use of the service. You should refer to `Google BigQuery documentation <https://cloud.google.com/bigquery/what-is-bigquery>`__
43244325
often as the service seems to be changing and evolving. BiqQuery is best for analyzing large
43254326
sets of data quickly, but it is not a direct replacement for a transactional database.
43264327

pandas/io/gbq.py

+25-6
Original file line numberDiff line numberDiff line change
@@ -525,12 +525,18 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
525525
526526
THIS IS AN EXPERIMENTAL LIBRARY
527527
528-
The main method a user calls to execute a Query in Google BigQuery and read
529-
results into a pandas DataFrame using the v2 Google API client for Python.
530-
Documentation for the API is available at
531-
https://developers.google.com/api-client-library/python/. Authentication
532-
to the Google BigQuery service is via OAuth 2.0 using the product name
533-
'pandas GBQ'.
528+
The main method a user calls to execute a Query in Google BigQuery
529+
and read results into a pandas DataFrame.
530+
531+
Google BigQuery API Client Library v2 for Python is used.
532+
Documentation is available at
533+
https://developers.google.com/api-client-library/python/apis/bigquery/v2
534+
535+
Authentication to the Google BigQuery service is via OAuth 2.0.
536+
By default user account credentials are used. You will be asked to
537+
grant permissions for product name 'pandas GBQ'. It is also posible
538+
to authenticate via service account credentials by using
539+
private_key parameter.
534540
535541
Parameters
536542
----------
@@ -615,6 +621,19 @@ def to_gbq(dataframe, destination_table, project_id, chunksize=10000,
615621
616622
THIS IS AN EXPERIMENTAL LIBRARY
617623
624+
The main method a user calls to export pandas DataFrame contents to
625+
Google BigQuery table.
626+
627+
Google BigQuery API Client Library v2 for Python is used.
628+
Documentation is available at
629+
https://developers.google.com/api-client-library/python/apis/bigquery/v2
630+
631+
Authentication to the Google BigQuery service is via OAuth 2.0.
632+
By default user account credentials are used. You will be asked to
633+
grant permissions for product name 'pandas GBQ'. It is also posible
634+
to authenticate via service account credentials by using
635+
private_key parameter.
636+
618637
Parameters
619638
----------
620639
dataframe : DataFrame

0 commit comments

Comments
 (0)