@@ -22,34 +22,26 @@ def _try_import():
2222
2323
2424def read_gbq (query , project_id = None , index_col = None , col_order = None ,
25- reauth = False , verbose = None , private_key = None , dialect = 'legacy' ,
26- ** kwargs ):
25+ reauth = False , private_key = None , auth_local_webserver = False ,
26+ dialect = 'legacy' , location = None , configuration = None ,
27+ verbose = None ):
2728 """
2829 Load data from Google BigQuery.
2930
3031 This function requires the `pandas-gbq package
3132 <https://pandas-gbq.readthedocs.io>`__.
3233
33- Authentication to the Google BigQuery service is via OAuth 2.0.
34-
35- - If "private_key" is not provided:
36-
37- By default "application default credentials" are used.
38-
39- If default application credentials are not found or are restrictive,
40- user account credentials are used. In this case, you will be asked to
41- grant permissions for product name 'pandas GBQ'.
42-
43- - If "private_key" is provided:
44-
45- Service account credentials will be used to authenticate.
34+ See the `How to authenticate with Google BigQuery
35+ <https://pandas-gbq.readthedocs.io/en/latest/howto/authentication.html>`__
36+ guide for authentication instructions.
4637
4738 Parameters
4839 ----------
4940 query : str
5041 SQL-Like Query to return data values.
51- project_id : str
52- Google BigQuery Account project ID.
42+ project_id : str, optional
43+ Google BigQuery Account project ID. Optional when available from
44+ the environment.
5345 index_col : str, optional
5446 Name of result column to use for index in results DataFrame.
5547 col_order : list(str), optional
@@ -62,6 +54,16 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
6254 Service account private key in JSON format. Can be file path
6355 or string contents. This is useful for remote server
6456 authentication (eg. Jupyter/IPython notebook on remote host).
57+ auth_local_webserver : boolean, default False
58+ Use the `local webserver flow`_ instead of the `console flow`_
59+ when getting user credentials.
60+
61+ .. _local webserver flow:
62+ http://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_local_server
63+ .. _console flow:
64+ http://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_console
65+
66+ *New in version 0.2.0 of pandas-gbq*.
6567 dialect : str, default 'legacy'
6668 SQL syntax dialect to use. Value can be one of:
6769
@@ -74,19 +76,26 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
7476 compliant with the SQL 2011 standard. For more information
7577 see `BigQuery Standard SQL Reference
7678 <https://cloud.google.com/bigquery/docs/reference/standard-sql/>`__.
77- verbose : boolean, deprecated
78- *Deprecated in Pandas-GBQ 0.4.0.* Use the `logging module
79- to adjust verbosity instead
80- <https://pandas-gbq.readthedocs.io/en/latest/intro.html#logging>`__.
81- kwargs : dict
82- Arbitrary keyword arguments.
83- configuration (dict): query config parameters for job processing.
79+ location : str, optional
80+ Location where the query job should run. See the `BigQuery locations
81+ documentation
82+ <https://cloud.google.com/bigquery/docs/dataset-locations>`__ for a
83+ list of available locations. The location must match that of any
84+ datasets used in the query.
85+
86+ *New in version 0.5.0 of pandas-gbq*.
87+ configuration : dict, optional
88+ Query config parameters for job processing.
8489 For example:
8590
8691 configuration = {'query': {'useQueryCache': False}}
8792
88- For more information see `BigQuery SQL Reference
89- <https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query>`__
93+ For more information see `BigQuery REST API Reference
94+ <https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query>`__.
95+ verbose : None, deprecated
96+ Deprecated in Pandas-GBQ 0.4.0. Use the `logging module
97+ to adjust verbosity instead
98+ <https://pandas-gbq.readthedocs.io/en/latest/intro.html#logging>`__.
9099
91100 Returns
92101 -------
@@ -100,20 +109,21 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
100109 """
101110 pandas_gbq = _try_import ()
102111 return pandas_gbq .read_gbq (
103- query , project_id = project_id ,
104- index_col = index_col , col_order = col_order ,
105- reauth = reauth , verbose = verbose ,
106- private_key = private_key ,
107- dialect = dialect ,
108- ** kwargs )
112+ query , project_id = project_id , index_col = index_col ,
113+ col_order = col_order , reauth = reauth , verbose = verbose ,
114+ private_key = private_key , auth_local_webserver = auth_local_webserver ,
115+ dialect = dialect , location = location , configuration = configuration )
109116
110117
111- def to_gbq (dataframe , destination_table , project_id , chunksize = None ,
118+ def to_gbq (dataframe , destination_table , project_id = None , chunksize = None ,
112119 verbose = None , reauth = False , if_exists = 'fail' , private_key = None ,
113- auth_local_webserver = False , table_schema = None ):
120+ auth_local_webserver = False , table_schema = None , location = None ,
121+ progress_bar = True ):
114122 pandas_gbq = _try_import ()
115123 return pandas_gbq .to_gbq (
116- dataframe , destination_table , project_id , chunksize = chunksize ,
117- verbose = verbose , reauth = reauth , if_exists = if_exists ,
118- private_key = private_key , auth_local_webserver = auth_local_webserver ,
119- table_schema = table_schema )
124+ dataframe , destination_table , project_id = project_id ,
125+ chunksize = chunksize , verbose = verbose , reauth = reauth ,
126+ if_exists = if_exists , private_key = private_key ,
127+ auth_local_webserver = auth_local_webserver ,
128+ table_schema = table_schema , location = location ,
129+ progress_bar = progress_bar )
0 commit comments