diff --git a/doc/source/io.rst b/doc/source/io.rst index e2f2301beb078..a42b5dab25578 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -4153,7 +4153,7 @@ to existing tables. .. warning:: To use this module, you will need a valid BigQuery account. Refer to the - `BigQuery Documentation `__ for details on the service itself. + `BigQuery Documentation `__ for details on the service itself. The key functions are: @@ -4173,17 +4173,18 @@ The key functions are: Authentication '''''''''''''' - -Authentication is possible with either user account credentials or service account credentials. +Authentication to the Google ``BigQuery`` service is via ``OAuth 2.0``. +Is possible to authenticate with either user account credentials or service account credentials. Authenticating with user account credentials is as simple as following the prompts in a browser window which will be automatically opened for you. You will be authenticated to the specified -``BigQuery`` account via Google's ``Oauth2`` mechanism. Additional information on the -authentication mechanism can be found `here `__. +``BigQuery`` account using the product name ``pandas GBQ``. It is only possible on local host. +The remote authentication using user account credentials is not currently supported in Pandas. +Additional information on the authentication mechanism can be found +`here `__. Authentication with service account credentials is possible via the `'private_key'` parameter. This method is particularly useful when working on remote servers (eg. jupyter iPython notebook on remote host). -The remote authentication using user account credentials is not currently supported in Pandas. Additional information on service accounts can be found `here `__. @@ -4314,13 +4315,13 @@ For example: .. note:: The BigQuery SQL query language has some oddities, see the - `BigQuery Query Reference Documentation `__. + `BigQuery Query Reference Documentation `__. .. note:: While BigQuery uses SQL-like syntax, it has some important differences from traditional databases both in functionality, API limitations (size and quantity of queries or uploads), - and how Google charges for use of the service. You should refer to `Google BigQuery documentation `__ + and how Google charges for use of the service. You should refer to `Google BigQuery documentation `__ often as the service seems to be changing and evolving. BiqQuery is best for analyzing large sets of data quickly, but it is not a direct replacement for a transactional database. diff --git a/pandas/io/gbq.py b/pandas/io/gbq.py index 96e72cbf9f528..c7481a953e47b 100644 --- a/pandas/io/gbq.py +++ b/pandas/io/gbq.py @@ -525,12 +525,18 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None, THIS IS AN EXPERIMENTAL LIBRARY - The main method a user calls to execute a Query in Google BigQuery and read - results into a pandas DataFrame using the v2 Google API client for Python. - Documentation for the API is available at - https://developers.google.com/api-client-library/python/. Authentication - to the Google BigQuery service is via OAuth 2.0 using the product name - 'pandas GBQ'. + The main method a user calls to execute a Query in Google BigQuery + and read results into a pandas DataFrame. + + Google BigQuery API Client Library v2 for Python is used. + Documentation is available at + https://developers.google.com/api-client-library/python/apis/bigquery/v2 + + Authentication to the Google BigQuery service is via OAuth 2.0. + By default user account credentials are used. You will be asked to + grant permissions for product name 'pandas GBQ'. It is also posible + to authenticate via service account credentials by using + private_key parameter. Parameters ---------- @@ -615,6 +621,19 @@ def to_gbq(dataframe, destination_table, project_id, chunksize=10000, THIS IS AN EXPERIMENTAL LIBRARY + The main method a user calls to export pandas DataFrame contents to + Google BigQuery table. + + Google BigQuery API Client Library v2 for Python is used. + Documentation is available at + https://developers.google.com/api-client-library/python/apis/bigquery/v2 + + Authentication to the Google BigQuery service is via OAuth 2.0. + By default user account credentials are used. You will be asked to + grant permissions for product name 'pandas GBQ'. It is also posible + to authenticate via service account credentials by using + private_key parameter. + Parameters ---------- dataframe : DataFrame