Skip to content

Commit 28f5411

Browse files
committed
Fix more tests
1 parent 04f3d9d commit 28f5411

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pandas/tests/frame/test_reductions.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,9 @@ def test_any_all_extra(self):
12371237
@pytest.mark.parametrize("axis", [0, 1])
12381238
@pytest.mark.parametrize("bool_agg_func", ["any", "all"])
12391239
@pytest.mark.parametrize("skipna", [True, False])
1240-
def test_any_all_object_dtype(self, axis, bool_agg_func, skipna):
1240+
def test_any_all_object_dtype(
1241+
self, axis, bool_agg_func, skipna, using_infer_string
1242+
):
12411243
# GH#35450
12421244
df = DataFrame(
12431245
data=[
@@ -1247,8 +1249,13 @@ def test_any_all_object_dtype(self, axis, bool_agg_func, skipna):
12471249
[np.nan, np.nan, "5", np.nan],
12481250
]
12491251
)
1252+
if using_infer_string:
1253+
# na in object is True while in string pyarrow numpy it's false
1254+
val = False if axis == 0 and not skipna and bool_agg_func == "all" else True
1255+
else:
1256+
val = True
12501257
result = getattr(df, bool_agg_func)(axis=axis, skipna=skipna)
1251-
expected = Series([True, True, True, True])
1258+
expected = Series([True, True, val, True])
12521259
tm.assert_series_equal(result, expected)
12531260

12541261
# GH#50947 deprecates this but it is not emitting a warning in some builds.

0 commit comments

Comments
 (0)