@@ -508,13 +508,6 @@ def test_groupby_extension_no_sort(self, data_for_grouping, request):
508
508
reason = f"{ pa_dtype } only has 2 unique possible values" ,
509
509
)
510
510
)
511
- elif pa .types .is_duration (pa_dtype ):
512
- request .node .add_marker (
513
- pytest .mark .xfail (
514
- raises = pa .ArrowNotImplementedError ,
515
- reason = f"pyarrow doesn't support factorizing { pa_dtype } " ,
516
- )
517
- )
518
511
super ().test_groupby_extension_no_sort (data_for_grouping )
519
512
520
513
def test_groupby_extension_transform (self , data_for_grouping , request ):
@@ -525,13 +518,6 @@ def test_groupby_extension_transform(self, data_for_grouping, request):
525
518
reason = f"{ pa_dtype } only has 2 unique possible values" ,
526
519
)
527
520
)
528
- elif pa .types .is_duration (pa_dtype ):
529
- request .node .add_marker (
530
- pytest .mark .xfail (
531
- raises = pa .ArrowNotImplementedError ,
532
- reason = f"pyarrow doesn't support factorizing { pa_dtype } " ,
533
- )
534
- )
535
521
with tm .maybe_produces_warning (
536
522
PerformanceWarning ,
537
523
pa_version_under7p0 and not pa .types .is_duration (pa_dtype ),
@@ -542,14 +528,6 @@ def test_groupby_extension_transform(self, data_for_grouping, request):
542
528
def test_groupby_extension_apply (
543
529
self , data_for_grouping , groupby_apply_op , request
544
530
):
545
- pa_dtype = data_for_grouping .dtype .pyarrow_dtype
546
- if pa .types .is_duration (pa_dtype ):
547
- request .node .add_marker (
548
- pytest .mark .xfail (
549
- raises = pa .ArrowNotImplementedError ,
550
- reason = f"pyarrow doesn't support factorizing { pa_dtype } " ,
551
- )
552
- )
553
531
with tm .maybe_produces_warning (
554
532
PerformanceWarning ,
555
533
pa_version_under7p0 and not pa .types .is_duration (pa_dtype ),
@@ -567,13 +545,6 @@ def test_groupby_extension_agg(self, as_index, data_for_grouping, request):
567
545
reason = f"{ pa_dtype } only has 2 unique possible values" ,
568
546
)
569
547
)
570
- elif pa .types .is_duration (pa_dtype ):
571
- request .node .add_marker (
572
- pytest .mark .xfail (
573
- raises = pa .ArrowNotImplementedError ,
574
- reason = f"pyarrow doesn't support factorizing { pa_dtype } " ,
575
- )
576
- )
577
548
with tm .maybe_produces_warning (
578
549
PerformanceWarning ,
579
550
pa_version_under7p0 and not pa .types .is_duration (pa_dtype ),
@@ -796,25 +767,9 @@ def test_diff(self, data, periods, request):
796
767
@pytest .mark .filterwarnings ("ignore:Falling back:pandas.errors.PerformanceWarning" )
797
768
@pytest .mark .parametrize ("dropna" , [True , False ])
798
769
def test_value_counts (self , all_data , dropna , request ):
799
- pa_dtype = all_data .dtype .pyarrow_dtype
800
- if pa .types .is_duration (pa_dtype ):
801
- request .node .add_marker (
802
- pytest .mark .xfail (
803
- raises = pa .ArrowNotImplementedError ,
804
- reason = f"value_count has no kernel for { pa_dtype } " ,
805
- )
806
- )
807
770
super ().test_value_counts (all_data , dropna )
808
771
809
772
def test_value_counts_with_normalize (self , data , request ):
810
- pa_dtype = data .dtype .pyarrow_dtype
811
- if pa .types .is_duration (pa_dtype ):
812
- request .node .add_marker (
813
- pytest .mark .xfail (
814
- raises = pa .ArrowNotImplementedError ,
815
- reason = f"value_count has no pyarrow kernel for { pa_dtype } " ,
816
- )
817
- )
818
773
with tm .maybe_produces_warning (
819
774
PerformanceWarning ,
820
775
pa_version_under7p0 and not pa .types .is_duration (pa_dtype ),
@@ -896,17 +851,6 @@ def test_nargsort(self, data_missing_for_sorting, na_position, expected):
896
851
897
852
@pytest .mark .parametrize ("ascending" , [True , False ])
898
853
def test_sort_values (self , data_for_sorting , ascending , sort_by_key , request ):
899
- pa_dtype = data_for_sorting .dtype .pyarrow_dtype
900
- if pa .types .is_duration (pa_dtype ) and not ascending :
901
- request .node .add_marker (
902
- pytest .mark .xfail (
903
- raises = pa .ArrowNotImplementedError ,
904
- reason = (
905
- f"unique has no pyarrow kernel "
906
- f"for { pa_dtype } when ascending={ ascending } "
907
- ),
908
- )
909
- )
910
854
with tm .maybe_produces_warning (
911
855
PerformanceWarning , pa_version_under7p0 , check_stacklevel = False
912
856
):
@@ -925,76 +869,23 @@ def test_sort_values_missing(
925
869
926
870
@pytest .mark .parametrize ("ascending" , [True , False ])
927
871
def test_sort_values_frame (self , data_for_sorting , ascending , request ):
928
- pa_dtype = data_for_sorting .dtype .pyarrow_dtype
929
- if pa .types .is_duration (pa_dtype ):
930
- request .node .add_marker (
931
- pytest .mark .xfail (
932
- raises = pa .ArrowNotImplementedError ,
933
- reason = (
934
- f"dictionary_encode has no pyarrow kernel "
935
- f"for { pa_dtype } when ascending={ ascending } "
936
- ),
937
- )
938
- )
939
872
with tm .maybe_produces_warning (
940
873
PerformanceWarning ,
941
874
pa_version_under7p0 and not pa .types .is_duration (pa_dtype ),
942
875
check_stacklevel = False ,
943
876
):
944
877
super ().test_sort_values_frame (data_for_sorting , ascending )
945
878
946
- @pytest .mark .parametrize ("box" , [pd .Series , lambda x : x ])
947
- @pytest .mark .parametrize ("method" , [lambda x : x .unique (), pd .unique ])
948
- def test_unique (self , data , box , method , request ):
949
- pa_dtype = data .dtype .pyarrow_dtype
950
- if pa .types .is_duration (pa_dtype ):
951
- request .node .add_marker (
952
- pytest .mark .xfail (
953
- raises = pa .ArrowNotImplementedError ,
954
- reason = f"unique has no pyarrow kernel for { pa_dtype } ." ,
955
- )
956
- )
957
- super ().test_unique (data , box , method )
958
-
959
879
def test_factorize (self , data_for_grouping , request ):
960
880
pa_dtype = data_for_grouping .dtype .pyarrow_dtype
961
- if pa .types .is_duration (pa_dtype ):
962
- request .node .add_marker (
963
- pytest .mark .xfail (
964
- raises = pa .ArrowNotImplementedError ,
965
- reason = f"dictionary_encode has no pyarrow kernel for { pa_dtype } " ,
966
- )
967
- )
968
- elif pa .types .is_boolean (pa_dtype ):
881
+ if pa .types .is_boolean (pa_dtype ):
969
882
request .node .add_marker (
970
883
pytest .mark .xfail (
971
884
reason = f"{ pa_dtype } only has 2 unique possible values" ,
972
885
)
973
886
)
974
887
super ().test_factorize (data_for_grouping )
975
888
976
- def test_factorize_equivalence (self , data_for_grouping , request ):
977
- pa_dtype = data_for_grouping .dtype .pyarrow_dtype
978
- if pa .types .is_duration (pa_dtype ):
979
- request .node .add_marker (
980
- pytest .mark .xfail (
981
- raises = pa .ArrowNotImplementedError ,
982
- reason = f"dictionary_encode has no pyarrow kernel for { pa_dtype } " ,
983
- )
984
- )
985
- super ().test_factorize_equivalence (data_for_grouping )
986
-
987
- def test_factorize_empty (self , data , request ):
988
- pa_dtype = data .dtype .pyarrow_dtype
989
- if pa .types .is_duration (pa_dtype ):
990
- request .node .add_marker (
991
- pytest .mark .xfail (
992
- raises = pa .ArrowNotImplementedError ,
993
- reason = f"dictionary_encode has no pyarrow kernel for { pa_dtype } " ,
994
- )
995
- )
996
- super ().test_factorize_empty (data )
997
-
998
889
@pytest .mark .xfail (
999
890
reason = "result dtype pyarrow[bool] better than expected dtype object"
1000
891
)
0 commit comments