Skip to content

Commit edd2939

Browse files
committed
BUG: fix to_gbq calling convention; now its a bound method of DataFrame
xref pandas-dev#15484
1 parent e0647ba commit edd2939

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

pandas/core/frame.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -942,11 +942,6 @@ def to_gbq(self, destination_table, project_id, chunksize=10000,
942942
chunksize=chunksize, verbose=verbose, reauth=reauth,
943943
if_exists=if_exists, private_key=private_key)
944944

945-
def _f():
946-
from pandas.io.gbq import _try_import
947-
return _try_import().to_gbq.__doc__
948-
to_gbq = docstring_wrapper(to_gbq, _f)
949-
950945
@classmethod
951946
def from_records(cls, data, index=None, exclude=None, columns=None,
952947
coerce_float=False, nrows=None):
@@ -5430,6 +5425,17 @@ def combineMult(self, other):
54305425
_EMPTY_SERIES = Series([])
54315426

54325427

5428+
# patch in the doc-string for to_gbq
5429+
# and bind this method
5430+
def _f():
5431+
from pandas.io.gbq import _try_import
5432+
return _try_import().to_gbq.__doc__
5433+
5434+
5435+
DataFrame.to_gbq = types.MethodType(docstring_wrapper(DataFrame.to_gbq, _f),
5436+
DataFrame)
5437+
5438+
54335439
def _arrays_to_mgr(arrays, arr_names, index, columns, dtype=None):
54345440
"""
54355441
Segregate Series based on type and coerce into matrices.

pandas/util/decorators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def __init__(self, func, creator, default=None):
259259
self, func, [attr for attr in self._attrs
260260
if hasattr(func, attr)])
261261

262-
def __call__(self, func, *args, **kwargs):
262+
def __call__(self, *args, **kwargs):
263263
return self.func(*args, **kwargs)
264264

265265
@property

0 commit comments

Comments
 (0)