DEPR: non-keyword arguments in any by yadav-sachin · Pull Request #44896 · pandas-dev/pandas (original) (raw)
What needs to be changed for the failing checks?
You'll need to update those tests such that they don't throw a warning
=================================== FAILURES ===================================
__________________ TestDataFrameAnalytics.test_any_all_extra ___________________
[gw1] linux -- Python 3.10.4 /usr/share/miniconda/envs/pandas-dev/bin/python
self = <pandas.tests.frame.test_reductions.TestDataFrameAnalytics object at 0x7feb4634aa40>
def test_any_all_extra(self):
df = DataFrame(
{
"A": [True, False, False],
"B": [True, True, False],
"C": [True, True, True],
},
index=["a", "b", "c"],
)
> result = df[["A", "B"]].any(1)
pandas/tests/frame/test_reductions.py:1058:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = ( A B
a True True
b False True
c False False, 1)
kwargs = {}, arguments = ''
@wraps(func)
def wrapper(*args, **kwargs):
arguments = _format_argument_list(allow_args)
if len(args) > num_allow_args:
> warnings.warn(
msg.format(arguments=arguments),
FutureWarning,
stacklevel=stacklevel,
)
E FutureWarning: In a future version of pandas all arguments of DataFrame.any and Series.any will be keyword-only.
pandas/util/_decorators.py:[31](https://github.com/pandas-dev/pandas/runs/5830982510?check_suite_focus=true#step:11:31)2: FutureWarning
So, change result = df[["A", "B"]].any(1)
to result = df[["A", "B"]].any(axis=1)
, and likewise for the others