@@ -1119,7 +1119,7 @@ def to_dict(self, orient='dict', into=dict):
1119
1119
def to_gbq (
1120
1120
self , destination_table , project_id , chunksize = 10000 ,
1121
1121
verbose = True , reauth = False , if_exists = 'fail' , private_key = None ,
1122
- ** kwargs ):
1122
+ auth_local_webserver = False , table_schema = None ):
1123
1123
"""
1124
1124
Write a DataFrame to a Google BigQuery table.
1125
1125
@@ -1142,6 +1142,8 @@ def to_gbq(
1142
1142
1143
1143
Parameters
1144
1144
----------
1145
+ dataframe : DataFrame
1146
+ DataFrame to be written to Google BigQuery.
1145
1147
destination_table : string
1146
1148
Name of table to be written, in the form 'dataset.tablename'.
1147
1149
project_id : str
@@ -1163,35 +1165,35 @@ def to_gbq(
1163
1165
Service account private key in JSON format. Can be file path
1164
1166
or string contents. This is useful for remote server
1165
1167
authentication (eg. Jupyter/IPython notebook on remote host).
1166
- kwargs : dict
1167
- Arbitrary keyword arguments.
1168
-
1169
- auth_local_webserver (boolean): default False
1170
- Use the [local webserver flow] instead of the [console flow]
1171
- when getting user credentials.
1172
-
1173
- .. [local webserver flow]
1174
- http://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_local_server
1175
- .. [console flow]
1176
- http://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_console
1177
- .. versionadded:: pandas-gbq-0.2.0
1178
- table_schema (list of dicts):
1179
- List of BigQuery table fields to which according DataFrame
1180
- columns conform to, e.g. `[{'name': 'col1', 'type':
1181
- 'STRING'},...]`. If schema is not provided, it will be
1182
- generated according to dtypes of DataFrame columns. See
1183
- BigQuery API documentation on available names of a field.
1184
- .. versionadded:: pandas-gbq-0.3.1
1168
+ auth_local_webserver : boolean (default False)
1169
+ Use the [local webserver flow] instead of the [console flow]
1170
+ when getting user credentials.
1171
+
1172
+ .. [local webserver flow]
1173
+ http://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_local_server
1174
+ .. [console flow]
1175
+ http://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_console
1176
+
1177
+ *New in version 0.2.0 of pandas-gbq*.
1178
+ table_schema : list of dicts (optional)
1179
+ List of BigQuery table fields to which according DataFrame
1180
+ columns conform to, e.g. `[{'name': 'col1', 'type':
1181
+ 'STRING'},...]`. If schema is not provided, it will be
1182
+ generated according to dtypes of DataFrame columns. See
1183
+ BigQuery API documentation on available names of a field.
1184
+
1185
+ *New in version 0.3.1 of pandas-gbq*.
1185
1186
1186
1187
See Also
1187
1188
--------
1188
- pandas_gbq.to_gbq
1189
+ pandas_gbq.to_gbq : This function in the pandas-gbq library.
1189
1190
"""
1190
1191
from pandas .io import gbq
1191
1192
return gbq .to_gbq (
1192
1193
self , destination_table , project_id , chunksize = chunksize ,
1193
1194
verbose = verbose , reauth = reauth , if_exists = if_exists ,
1194
- private_key = private_key , ** kwargs )
1195
+ private_key = private_key , auth_local_webserver = auth_local_webserver ,
1196
+ table_schema = table_schema )
1195
1197
1196
1198
1197
1199
@classmethod
0 commit comments