Skip to content

Commit 18eb031

Browse files
committed
doc
1 parent 616c357 commit 18eb031

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/util/_decorators.py

+4
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,15 @@ def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None, stacklevel=2):
8383
...
8484
>>> f(columns='should work ok')
8585
should work ok
86+
8687
>>> f(cols='should raise warning')
8788
FutureWarning: cols is deprecated, use columns instead
8889
warnings.warn(msg, FutureWarning)
8990
should raise warning
91+
9092
>>> f(cols='should error', columns="can\'t pass do both")
9193
TypeError: Can only specify 'cols' or 'columns', not both
94+
9295
>>> @deprecate_kwarg('old', 'new', {'yes': True, 'no': False})
9396
... def f(new=False):
9497
... print('yes!' if new else 'no!')
@@ -111,6 +114,7 @@ def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None, stacklevel=2):
111114
should raise warning
112115
>>> f(another_param='should not raise warning')
113116
should not raise warning
117+
114118
>>> f(cols='should raise warning', another_param='')
115119
FutureWarning: the 'cols' keyword is deprecated and will be removed in a
116120
future version please takes steps to stop use of 'cols'

0 commit comments

Comments
 (0)