@@ -467,17 +467,14 @@ def test_accumulate_series(self, data, all_numeric_accumulations, skipna, reques
467467 self .check_accumulate (ser , op_name , skipna )
468468
469469 def _supports_reduction (self , ser : pd .Series , op_name : str ) -> bool :
470+ if op_name in ["kurt" , "skew" ]:
471+ return False
472+
470473 dtype = ser .dtype
471474 # error: Item "dtype[Any]" of "dtype[Any] | ExtensionDtype" has
472475 # no attribute "pyarrow_dtype"
473476 pa_dtype = dtype .pyarrow_dtype # type: ignore[union-attr]
474- if pa .types .is_temporal (pa_dtype ) and op_name in [
475- "sum" ,
476- "var" ,
477- "skew" ,
478- "kurt" ,
479- "prod" ,
480- ]:
477+ if pa .types .is_temporal (pa_dtype ) and op_name in ["sum" , "var" , "prod" ]:
481478 if pa .types .is_duration (pa_dtype ) and op_name in ["sum" ]:
482479 # summing timedeltas is one case that *is* well-defined
483480 pass
@@ -493,8 +490,6 @@ def _supports_reduction(self, ser: pd.Series, op_name: str) -> bool:
493490 "std" ,
494491 "sem" ,
495492 "var" ,
496- "skew" ,
497- "kurt" ,
498493 ]:
499494 return False
500495
@@ -541,23 +536,6 @@ def check_reduce(self, ser: pd.Series, op_name: str, skipna: bool):
541536 expected = getattr (alt , op_name )(skipna = skipna )
542537 tm .assert_almost_equal (result , expected )
543538
544- @pytest .mark .parametrize ("skipna" , [True , False ])
545- def test_reduce_series_numeric (self , data , all_numeric_reductions , skipna , request ):
546- dtype = data .dtype
547- pa_dtype = dtype .pyarrow_dtype
548-
549- xfail_mark = pytest .mark .xfail (
550- raises = TypeError ,
551- reason = (
552- f"{ all_numeric_reductions } is not implemented in "
553- f"pyarrow={ pa .__version__ } for { pa_dtype } "
554- ),
555- )
556- if all_numeric_reductions in {"skew" , "kurt" } and dtype ._is_numeric :
557- request .applymarker (xfail_mark )
558-
559- super ().test_reduce_series_numeric (data , all_numeric_reductions , skipna )
560-
561539 @pytest .mark .parametrize ("skipna" , [True , False ])
562540 def test_reduce_series_boolean (
563541 self , data , all_boolean_reductions , skipna , na_value , request
@@ -596,11 +574,11 @@ def _get_expected_reduction_dtype(self, arr, op_name: str, skipna: bool):
596574 else :
597575 cmp_dtype = arr .dtype
598576 elif arr .dtype .name == "decimal128(7, 3)[pyarrow]" :
599- if op_name not in ["median" , "var" , "std" ]:
577+ if op_name not in ["median" , "var" , "std" , "sem" ]:
600578 cmp_dtype = arr .dtype
601579 else :
602580 cmp_dtype = "float64[pyarrow]"
603- elif op_name in ["median" , "var" , "std" , "mean" , "skew" ]:
581+ elif op_name in ["median" , "var" , "std" , "mean" , "skew" , "sem" ]:
604582 cmp_dtype = "float64[pyarrow]"
605583 elif op_name in ["sum" , "prod" ] and pa .types .is_boolean (pa_type ):
606584 cmp_dtype = "uint64[pyarrow]"
@@ -619,7 +597,11 @@ def test_reduce_frame(self, data, all_numeric_reductions, skipna, request):
619597 if data .dtype ._is_numeric :
620598 mark = pytest .mark .xfail (reason = "skew not implemented" )
621599 request .applymarker (mark )
622- elif op_name == "std" and pa .types .is_date64 (data ._pa_array .type ) and skipna :
600+ elif (
601+ op_name in ["std" , "sem" ]
602+ and pa .types .is_date64 (data ._pa_array .type )
603+ and skipna
604+ ):
623605 # overflow
624606 mark = pytest .mark .xfail (reason = "Cannot cast" )
625607 request .applymarker (mark )
0 commit comments