diff --git a/pandas/tests/frame/test_reductions.py b/pandas/tests/frame/test_reductions.py index 744d06d6cf339..963ed24cb434b 100644 --- a/pandas/tests/frame/test_reductions.py +++ b/pandas/tests/frame/test_reductions.py @@ -168,7 +168,15 @@ class TestDataFrameAnalytics: ], ) def test_stat_op_api_float_string_frame(self, float_string_frame, axis, opname): - getattr(float_string_frame, opname)(axis=axis) + if opname in ["sum", "min", "max"] and axis == 0: + warn = None + elif opname not in ["count", "nunique"]: + warn = FutureWarning + else: + warn = None + msg = "nuisance columns|default value of numeric_only" + with tm.assert_produces_warning(warn, match=msg): + getattr(float_string_frame, opname)(axis=axis) if opname != "nunique": getattr(float_string_frame, opname)(axis=axis, numeric_only=True)