@@ -1237,7 +1237,9 @@ def test_any_all_extra(self):
1237
1237
@pytest .mark .parametrize ("axis" , [0 , 1 ])
1238
1238
@pytest .mark .parametrize ("bool_agg_func" , ["any" , "all" ])
1239
1239
@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
+ ):
1241
1243
# GH#35450
1242
1244
df = DataFrame (
1243
1245
data = [
@@ -1247,8 +1249,13 @@ def test_any_all_object_dtype(self, axis, bool_agg_func, skipna):
1247
1249
[np .nan , np .nan , "5" , np .nan ],
1248
1250
]
1249
1251
)
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
1250
1257
result = getattr (df , bool_agg_func )(axis = axis , skipna = skipna )
1251
- expected = Series ([True , True , True , True ])
1258
+ expected = Series ([True , True , val , True ])
1252
1259
tm .assert_series_equal (result , expected )
1253
1260
1254
1261
# GH#50947 deprecates this but it is not emitting a warning in some builds.
0 commit comments