@@ -226,6 +226,7 @@ def float_frame_with_na():
226226class TestDataFrameAnalytics :
227227 # ---------------------------------------------------------------------
228228 # Reductions
229+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
229230 @pytest .mark .parametrize ("axis" , [0 , 1 ])
230231 @pytest .mark .parametrize (
231232 "opname" ,
@@ -431,6 +432,7 @@ def test_stat_operators_attempt_obj_array(self, method, df, axis):
431432 expected [expected .isna ()] = None
432433 tm .assert_series_equal (result , expected )
433434
435+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
434436 @pytest .mark .parametrize ("op" , ["mean" , "std" , "var" , "skew" , "kurt" , "sem" ])
435437 def test_mixed_ops (self , op ):
436438 # GH#16116
@@ -532,7 +534,7 @@ def test_mean_mixed_string_decimal(self):
532534 df = DataFrame (d )
533535
534536 with pytest .raises (
535- TypeError , match = "unsupported operand type|does not support"
537+ TypeError , match = "unsupported operand type|does not support|Cannot perform "
536538 ):
537539 df .mean ()
538540 result = df [["A" , "C" ]].mean ()
@@ -690,6 +692,7 @@ def test_mode_dropna(self, dropna, expected):
690692 expected = DataFrame (expected )
691693 tm .assert_frame_equal (result , expected )
692694
695+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
693696 def test_mode_sortwarning (self , using_infer_string ):
694697 # Check for the warning that is raised when the mode
695698 # results cannot be sorted
@@ -979,7 +982,7 @@ def test_sum_mixed_datetime(self):
979982
980983 def test_mean_corner (self , float_frame , float_string_frame ):
981984 # unit test when have object data
982- msg = "Could not convert|does not support"
985+ msg = "Could not convert|does not support|Cannot perform "
983986 with pytest .raises (TypeError , match = msg ):
984987 float_string_frame .mean (axis = 0 )
985988
@@ -1093,6 +1096,7 @@ def test_idxmin_empty(self, index, skipna, axis):
10931096 expected = Series (dtype = index .dtype )
10941097 tm .assert_series_equal (result , expected )
10951098
1099+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
10961100 @pytest .mark .parametrize ("numeric_only" , [True , False ])
10971101 def test_idxmin_numeric_only (self , numeric_only ):
10981102 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):
11431147 expected = Series (dtype = index .dtype )
11441148 tm .assert_series_equal (result , expected )
11451149
1150+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
11461151 @pytest .mark .parametrize ("numeric_only" , [True , False ])
11471152 def test_idxmax_numeric_only (self , numeric_only ):
11481153 df = DataFrame ({"a" : [2 , 3 , 1 ], "b" : [2 , 1 , 1 ], "c" : list ("xyx" )})
@@ -1964,7 +1969,7 @@ def test_minmax_extensionarray(method, numeric_only):
19641969def test_frame_mixed_numeric_object_with_timestamp (ts_value ):
19651970 # GH 13912
19661971 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 " ):
19681973 df .sum ()
19691974
19701975
0 commit comments