@@ -461,24 +461,17 @@ def _supports_reduction(self, ser: pd.Series, op_name: str) -> bool:
461
461
# error: Item "dtype[Any]" of "dtype[Any] | ExtensionDtype" has
462
462
# no attribute "pyarrow_dtype"
463
463
pa_dtype = dtype .pyarrow_dtype # type: ignore[union-attr]
464
- if pa .types .is_temporal (pa_dtype ) and op_name in ["sum" , "var" , "prod" ]:
464
+ if pa .types .is_temporal (pa_dtype ) and op_name in ["sum" , "var" , "prod" , "skew" ]:
465
465
if pa .types .is_duration (pa_dtype ) and op_name in ["sum" ]:
466
466
# summing timedeltas is one case that *is* well-defined
467
467
pass
468
468
else :
469
469
return False
470
- elif pa .types .is_binary (pa_dtype ) and op_name == "sum" :
470
+ elif pa .types .is_binary (pa_dtype ) and op_name in [ "sum" , "skew" ] :
471
471
return False
472
472
elif (
473
473
pa .types .is_string (pa_dtype ) or pa .types .is_binary (pa_dtype )
474
- ) and op_name in [
475
- "mean" ,
476
- "median" ,
477
- "prod" ,
478
- "std" ,
479
- "sem" ,
480
- "var" ,
481
- ]:
474
+ ) and op_name in ["mean" , "median" , "prod" , "std" , "sem" , "var" , "skew" ]:
482
475
return False
483
476
484
477
if (
@@ -583,7 +576,7 @@ def _get_expected_reduction_dtype(self, arr, op_name: str, skipna: bool):
583
576
@pytest .mark .parametrize ("skipna" , [True , False ])
584
577
def test_reduce_frame (self , data , all_numeric_reductions , skipna , request ):
585
578
op_name = all_numeric_reductions
586
- if op_name == "skew" :
579
+ if op_name == "skew" and pa_version_under20p0 :
587
580
if data .dtype ._is_numeric :
588
581
mark = pytest .mark .xfail (reason = "skew not implemented" )
589
582
request .applymarker (mark )
0 commit comments