@@ -226,6 +226,7 @@ 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 )
229
230
@pytest .mark .parametrize ("axis" , [0 , 1 ])
230
231
@pytest .mark .parametrize (
231
232
"opname" ,
@@ -431,6 +432,7 @@ def test_stat_operators_attempt_obj_array(self, method, df, axis):
431
432
expected [expected .isna ()] = None
432
433
tm .assert_series_equal (result , expected )
433
434
435
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
434
436
@pytest .mark .parametrize ("op" , ["mean" , "std" , "var" , "skew" , "kurt" , "sem" ])
435
437
def test_mixed_ops (self , op ):
436
438
# GH#16116
@@ -532,7 +534,7 @@ def test_mean_mixed_string_decimal(self):
532
534
df = DataFrame (d )
533
535
534
536
with pytest .raises (
535
- TypeError , match = "unsupported operand type|does not support"
537
+ TypeError , match = "unsupported operand type|does not support|Cannot perform "
536
538
):
537
539
df .mean ()
538
540
result = df [["A" , "C" ]].mean ()
@@ -690,6 +692,7 @@ def test_mode_dropna(self, dropna, expected):
690
692
expected = DataFrame (expected )
691
693
tm .assert_frame_equal (result , expected )
692
694
695
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
693
696
def test_mode_sortwarning (self , using_infer_string ):
694
697
# Check for the warning that is raised when the mode
695
698
# results cannot be sorted
@@ -979,7 +982,7 @@ def test_sum_mixed_datetime(self):
979
982
980
983
def test_mean_corner (self , float_frame , float_string_frame ):
981
984
# unit test when have object data
982
- msg = "Could not convert|does not support"
985
+ msg = "Could not convert|does not support|Cannot perform "
983
986
with pytest .raises (TypeError , match = msg ):
984
987
float_string_frame .mean (axis = 0 )
985
988
@@ -1093,6 +1096,7 @@ def test_idxmin_empty(self, index, skipna, axis):
1093
1096
expected = Series (dtype = index .dtype )
1094
1097
tm .assert_series_equal (result , expected )
1095
1098
1099
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
1096
1100
@pytest .mark .parametrize ("numeric_only" , [True , False ])
1097
1101
def test_idxmin_numeric_only (self , numeric_only ):
1098
1102
df = DataFrame ({"a" : [2 , 3 , 1 ], "b" : [2 , 1 , 1 ], "c" : list ("xyx" )})
@@ -1143,6 +1147,7 @@ def test_idxmax_empty(self, index, skipna, axis):
1143
1147
expected = Series (dtype = index .dtype )
1144
1148
tm .assert_series_equal (result , expected )
1145
1149
1150
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
1146
1151
@pytest .mark .parametrize ("numeric_only" , [True , False ])
1147
1152
def test_idxmax_numeric_only (self , numeric_only ):
1148
1153
df = DataFrame ({"a" : [2 , 3 , 1 ], "b" : [2 , 1 , 1 ], "c" : list ("xyx" )})
@@ -1964,7 +1969,7 @@ def test_minmax_extensionarray(method, numeric_only):
1964
1969
def test_frame_mixed_numeric_object_with_timestamp (ts_value ):
1965
1970
# GH 13912
1966
1971
df = DataFrame ({"a" : [1 ], "b" : [1.1 ], "c" : ["foo" ], "d" : [ts_value ]})
1967
- with pytest .raises (TypeError , match = "does not support operation" ):
1972
+ with pytest .raises (TypeError , match = "does not support operation|Cannot perform " ):
1968
1973
df .sum ()
1969
1974
1970
1975
0 commit comments