31
31
pa_version_under8p0 ,
32
32
pa_version_under9p0 ,
33
33
)
34
+ from pandas .errors import PerformanceWarning
34
35
35
36
import pandas as pd
36
37
import pandas ._testing as tm
@@ -515,15 +516,6 @@ def test_groupby_extension_no_sort(self, data_for_grouping, request):
515
516
reason = f"pyarrow doesn't support factorizing { pa_dtype } " ,
516
517
)
517
518
)
518
- elif pa .types .is_date (pa_dtype ) or (
519
- pa .types .is_timestamp (pa_dtype ) and pa_dtype .tz is None
520
- ):
521
- request .node .add_marker (
522
- pytest .mark .xfail (
523
- raises = AttributeError ,
524
- reason = "GH 34986" ,
525
- )
526
- )
527
519
super ().test_groupby_extension_no_sort (data_for_grouping )
528
520
529
521
def test_groupby_extension_transform (self , data_for_grouping , request ):
@@ -547,8 +539,7 @@ def test_groupby_extension_apply(
547
539
self , data_for_grouping , groupby_apply_op , request
548
540
):
549
541
pa_dtype = data_for_grouping .dtype .pyarrow_dtype
550
- # Is there a better way to get the "series" ID for groupby_apply_op?
551
- is_series = "series" in request .node .nodeid
542
+ # TODO: Is there a better way to get the "object" ID for groupby_apply_op?
552
543
is_object = "object" in request .node .nodeid
553
544
if pa .types .is_duration (pa_dtype ):
554
545
request .node .add_marker (
@@ -567,14 +558,10 @@ def test_groupby_extension_apply(
567
558
reason = "GH 47514: _concat_datetime expects axis arg." ,
568
559
)
569
560
)
570
- elif not is_series :
571
- request .node .add_marker (
572
- pytest .mark .xfail (
573
- raises = AttributeError ,
574
- reason = "GH 34986" ,
575
- )
576
- )
577
- super ().test_groupby_extension_apply (data_for_grouping , groupby_apply_op )
561
+ with tm .maybe_produces_warning (
562
+ PerformanceWarning , pa_version_under7p0 , check_stacklevel = False
563
+ ):
564
+ super ().test_groupby_extension_apply (data_for_grouping , groupby_apply_op )
578
565
579
566
def test_in_numeric_groupby (self , data_for_grouping , request ):
580
567
pa_dtype = data_for_grouping .dtype .pyarrow_dtype
@@ -603,17 +590,10 @@ def test_groupby_extension_agg(self, as_index, data_for_grouping, request):
603
590
reason = f"pyarrow doesn't support factorizing { pa_dtype } " ,
604
591
)
605
592
)
606
- elif as_index is True and (
607
- pa .types .is_date (pa_dtype )
608
- or (pa .types .is_timestamp (pa_dtype ) and pa_dtype .tz is None )
593
+ with tm .maybe_produces_warning (
594
+ PerformanceWarning , pa_version_under7p0 , check_stacklevel = False
609
595
):
610
- request .node .add_marker (
611
- pytest .mark .xfail (
612
- raises = AttributeError ,
613
- reason = "GH 34986" ,
614
- )
615
- )
616
- super ().test_groupby_extension_agg (as_index , data_for_grouping )
596
+ super ().test_groupby_extension_agg (as_index , data_for_grouping )
617
597
618
598
619
599
class TestBaseDtype (base .BaseDtypeTests ):
@@ -1443,16 +1423,7 @@ def test_diff(self, data, periods, request):
1443
1423
@pytest .mark .parametrize ("dropna" , [True , False ])
1444
1424
def test_value_counts (self , all_data , dropna , request ):
1445
1425
pa_dtype = all_data .dtype .pyarrow_dtype
1446
- if pa .types .is_date (pa_dtype ) or (
1447
- pa .types .is_timestamp (pa_dtype ) and pa_dtype .tz is None
1448
- ):
1449
- request .node .add_marker (
1450
- pytest .mark .xfail (
1451
- raises = AttributeError ,
1452
- reason = "GH 34986" ,
1453
- )
1454
- )
1455
- elif pa .types .is_duration (pa_dtype ):
1426
+ if pa .types .is_duration (pa_dtype ):
1456
1427
request .node .add_marker (
1457
1428
pytest .mark .xfail (
1458
1429
raises = pa .ArrowNotImplementedError ,
@@ -1463,16 +1434,7 @@ def test_value_counts(self, all_data, dropna, request):
1463
1434
1464
1435
def test_value_counts_with_normalize (self , data , request ):
1465
1436
pa_dtype = data .dtype .pyarrow_dtype
1466
- if pa .types .is_date (pa_dtype ) or (
1467
- pa .types .is_timestamp (pa_dtype ) and pa_dtype .tz is None
1468
- ):
1469
- request .node .add_marker (
1470
- pytest .mark .xfail (
1471
- raises = AttributeError ,
1472
- reason = "GH 34986" ,
1473
- )
1474
- )
1475
- elif pa .types .is_duration (pa_dtype ):
1437
+ if pa .types .is_duration (pa_dtype ):
1476
1438
request .node .add_marker (
1477
1439
pytest .mark .xfail (
1478
1440
raises = pa .ArrowNotImplementedError ,
0 commit comments