@@ -226,7 +226,6 @@ def float_frame_with_na():
226
226
class TestDataFrameAnalytics :
227
227
# ---------------------------------------------------------------------
228
228
# Reductions
229
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
230
229
@pytest .mark .parametrize ("axis" , [0 , 1 ])
231
230
@pytest .mark .parametrize (
232
231
"opname" ,
@@ -246,17 +245,11 @@ class TestDataFrameAnalytics:
246
245
pytest .param ("kurt" , marks = td .skip_if_no ("scipy" )),
247
246
],
248
247
)
249
- def test_stat_op_api_float_string_frame (
250
- self , float_string_frame , axis , opname , using_infer_string
251
- ):
252
- if (
253
- (opname in ("sum" , "min" , "max" ) and axis == 0 )
254
- or opname
255
- in (
256
- "count" ,
257
- "nunique" ,
258
- )
259
- ) and not (using_infer_string and opname == "sum" ):
248
+ def test_stat_op_api_float_string_frame (self , float_string_frame , axis , opname ):
249
+ if (opname in ("sum" , "min" , "max" ) and axis == 0 ) or opname in (
250
+ "count" ,
251
+ "nunique" ,
252
+ ):
260
253
getattr (float_string_frame , opname )(axis = axis )
261
254
else :
262
255
if opname in ["var" , "std" , "sem" , "skew" , "kurt" ]:
@@ -432,7 +425,6 @@ def test_stat_operators_attempt_obj_array(self, method, df, axis):
432
425
expected [expected .isna ()] = None
433
426
tm .assert_series_equal (result , expected )
434
427
435
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
436
428
@pytest .mark .parametrize ("op" , ["mean" , "std" , "var" , "skew" , "kurt" , "sem" ])
437
429
def test_mixed_ops (self , op ):
438
430
# GH#16116
@@ -466,9 +458,6 @@ def test_mixed_ops(self, op):
466
458
with pytest .raises (TypeError , match = msg ):
467
459
getattr (df , op )()
468
460
469
- @pytest .mark .xfail (
470
- using_string_dtype (), reason = "sum doesn't work for arrow strings"
471
- )
472
461
def test_reduce_mixed_frame (self ):
473
462
# GH 6806
474
463
df = DataFrame (
@@ -608,7 +597,6 @@ def test_sem(self, datetime_frame):
608
597
result = nanops .nansem (arr , axis = 0 )
609
598
assert not (result < 0 ).any ()
610
599
611
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
612
600
@pytest .mark .parametrize (
613
601
"dropna, expected" ,
614
602
[
@@ -630,7 +618,7 @@ def test_sem(self, datetime_frame):
630
618
"A" : [12 ],
631
619
"B" : [10.0 ],
632
620
"C" : [np .nan ],
633
- "D" : np . array ([np .nan ], dtype = object ),
621
+ "D" : Series ([np .nan ], dtype = "str" ),
634
622
"E" : Categorical ([np .nan ], categories = ["a" ]),
635
623
"F" : DatetimeIndex ([pd .NaT ], dtype = "M8[ns]" ),
636
624
"G" : to_timedelta ([pd .NaT ]),
@@ -672,7 +660,7 @@ def test_mode_dropna(self, dropna, expected):
672
660
"A" : [12 , 12 , 19 , 11 ],
673
661
"B" : [10 , 10 , np .nan , 3 ],
674
662
"C" : [1 , np .nan , np .nan , np .nan ],
675
- "D" : Series ([np .nan , np .nan , "a" , np .nan ], dtype = object ),
663
+ "D" : Series ([np .nan , np .nan , "a" , np .nan ], dtype = "str" ),
676
664
"E" : Categorical ([np .nan , np .nan , "a" , np .nan ]),
677
665
"F" : DatetimeIndex (["NaT" , "2000-01-02" , "NaT" , "NaT" ], dtype = "M8[ns]" ),
678
666
"G" : to_timedelta (["1 days" , "nan" , "nan" , "nan" ]),
@@ -692,7 +680,6 @@ def test_mode_dropna(self, dropna, expected):
692
680
expected = DataFrame (expected )
693
681
tm .assert_frame_equal (result , expected )
694
682
695
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
696
683
def test_mode_sortwarning (self , using_infer_string ):
697
684
# Check for the warning that is raised when the mode
698
685
# results cannot be sorted
@@ -1354,11 +1341,8 @@ def test_any_all_extra(self):
1354
1341
result = df [["C" ]].all (axis = None ).item ()
1355
1342
assert result is True
1356
1343
1357
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
1358
1344
@pytest .mark .parametrize ("axis" , [0 , 1 ])
1359
- def test_any_all_object_dtype (
1360
- self , axis , all_boolean_reductions , skipna , using_infer_string
1361
- ):
1345
+ def test_any_all_object_dtype (self , axis , all_boolean_reductions , skipna ):
1362
1346
# GH#35450
1363
1347
df = DataFrame (
1364
1348
data = [
@@ -1368,13 +1352,8 @@ def test_any_all_object_dtype(
1368
1352
[np .nan , np .nan , "5" , np .nan ],
1369
1353
]
1370
1354
)
1371
- if using_infer_string :
1372
- # na in object is True while in string pyarrow numpy it's false
1373
- val = not axis == 0 and not skipna and all_boolean_reductions == "all"
1374
- else :
1375
- val = True
1376
1355
result = getattr (df , all_boolean_reductions )(axis = axis , skipna = skipna )
1377
- expected = Series ([True , True , val , True ])
1356
+ expected = Series ([True , True , True , True ])
1378
1357
tm .assert_series_equal (result , expected )
1379
1358
1380
1359
def test_any_datetime (self ):
@@ -1939,7 +1918,6 @@ def test_sum_timedelta64_skipna_false():
1939
1918
tm .assert_series_equal (result , expected )
1940
1919
1941
1920
1942
- @pytest .mark .xfail (using_string_dtype (), reason = "sum doesn't work with arrow strings" )
1943
1921
def test_mixed_frame_with_integer_sum ():
1944
1922
# https://github.com/pandas-dev/pandas/issues/34520
1945
1923
df = DataFrame ([["a" , 1 ]], columns = list ("ab" ))
0 commit comments