Skip to content

Commit 23889d3

Browse files
committed
BUG: fix calling convention for to_gbq, take 2
1 parent edd2939 commit 23889d3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pandas/core/frame.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -5432,8 +5432,7 @@ def _f():
54325432
return _try_import().to_gbq.__doc__
54335433

54345434

5435-
DataFrame.to_gbq = types.MethodType(docstring_wrapper(DataFrame.to_gbq, _f),
5436-
DataFrame)
5435+
DataFrame.to_gbq = docstring_wrapper(DataFrame.to_gbq, _f)
54375436

54385437

54395438
def _arrays_to_mgr(arrays, arr_names, index, columns, dtype=None):

pandas/util/decorators.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pandas.compat import StringIO, callable, signature
22
from pandas.lib import cache_readonly # noqa
3+
import types
34
import sys
45
import warnings
56
from textwrap import dedent
@@ -259,6 +260,10 @@ def __init__(self, func, creator, default=None):
259260
self, func, [attr for attr in self._attrs
260261
if hasattr(func, attr)])
261262

263+
def __get__(self, instance, cls=None):
264+
# we want to return the actual passed instance
265+
return types.MethodType(self, instance)
266+
262267
def __call__(self, *args, **kwargs):
263268
return self.func(*args, **kwargs)
264269

0 commit comments

Comments
 (0)