@@ -24,9 +24,9 @@ def _try_import():
24
24
25
25
26
26
def read_gbq (query , project_id = None , index_col = None , col_order = None ,
27
- reauth = False , private_key = None , auth_local_webserver = False ,
28
- dialect = None , location = None , configuration = None ,
29
- verbose = None ):
27
+ reauth = False , auth_local_webserver = False , dialect = None ,
28
+ location = None , configuration = None , credentials = None ,
29
+ private_key = None , verbose = None ):
30
30
"""
31
31
Load data from Google BigQuery.
32
32
@@ -98,10 +98,30 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
98
98
99
99
For more information see `BigQuery REST API Reference
100
100
<https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query>`__.
101
+ credentials : google.auth.credentials.Credentials, optional
102
+ Credentials for accessing Google APIs. Use this parameter to override
103
+ default credentials, such as to use Compute Engine
104
+ :class:`google.auth.compute_engine.Credentials` or Service Account
105
+ :class:`google.oauth2.service_account.Credentials` directly.
106
+
107
+ *New in version 0.8.0 of pandas-gbq*.
108
+
109
+ .. versionadded:: 0.24.0
101
110
verbose : None, deprecated
102
- Deprecated in Pandas-GBQ 0.4.0. Use the `logging module
103
- to adjust verbosity instead
111
+ Deprecated in pandas-gbq version 0.4.0. Use the `logging module to
112
+ adjust verbosity instead
104
113
<https://pandas-gbq.readthedocs.io/en/latest/intro.html#logging>`__.
114
+ private_key : str, deprecated
115
+ Deprecated in pandas-gbq version 0.8.0. Use the ``credentials``
116
+ parameter and
117
+ :func:`google.oauth2.service_account.Credentials.from_service_account_info`
118
+ or
119
+ :func:`google.oauth2.service_account.Credentials.from_service_account_file`
120
+ instead.
121
+
122
+ Service account private key in JSON format. Can be file path
123
+ or string contents. This is useful for remote server
124
+ authentication (eg. Jupyter/IPython notebook on remote host).
105
125
106
126
Returns
107
127
-------
@@ -127,20 +147,20 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
127
147
128
148
return pandas_gbq .read_gbq (
129
149
query , project_id = project_id , index_col = index_col ,
130
- col_order = col_order , reauth = reauth , verbose = verbose ,
131
- private_key = private_key , auth_local_webserver = auth_local_webserver ,
132
- dialect = dialect , location = location , configuration = configuration )
150
+ col_order = col_order , reauth = reauth ,
151
+ auth_local_webserver = auth_local_webserver , dialect = dialect ,
152
+ location = location , configuration = configuration ,
153
+ credentials = credentials , verbose = verbose , private_key = private_key )
133
154
134
155
135
156
def to_gbq (dataframe , destination_table , project_id = None , chunksize = None ,
136
- verbose = None , reauth = False , if_exists = 'fail' , private_key = None ,
137
- auth_local_webserver = False , table_schema = None , location = None ,
138
- progress_bar = True ):
157
+ reauth = False , if_exists = 'fail' , auth_local_webserver = False ,
158
+ table_schema = None , location = None , progress_bar = True ,
159
+ credentials = None , verbose = None , private_key = None ):
139
160
pandas_gbq = _try_import ()
140
161
return pandas_gbq .to_gbq (
141
162
dataframe , destination_table , project_id = project_id ,
142
- chunksize = chunksize , verbose = verbose , reauth = reauth ,
143
- if_exists = if_exists , private_key = private_key ,
144
- auth_local_webserver = auth_local_webserver ,
145
- table_schema = table_schema , location = location ,
146
- progress_bar = progress_bar )
163
+ chunksize = chunksize , reauth = reauth , if_exists = if_exists ,
164
+ auth_local_webserver = auth_local_webserver , table_schema = table_schema ,
165
+ location = location , progress_bar = progress_bar ,
166
+ credentials = credentials , verbose = verbose , private_key = private_key )
0 commit comments