@@ -356,12 +356,12 @@ def test_series_overloads_partition():
356
356
assert_type (s .str .partition (sep = ";" , expand = True ), pd .DataFrame ), pd .DataFrame
357
357
)
358
358
check (
359
- assert_type (s .str .partition (sep = ";" , expand = False ), " pd.Series[type[object]]" ),
359
+ assert_type (s .str .partition (sep = ";" , expand = False ), pd .Series ),
360
360
pd .Series ,
361
361
object ,
362
362
)
363
363
check (
364
- assert_type (s .str .partition (expand = False ), " pd.Series[type[object]]" ),
364
+ assert_type (s .str .partition (expand = False ), pd .Series ),
365
365
pd .Series ,
366
366
object ,
367
367
)
@@ -371,15 +371,11 @@ def test_series_overloads_partition():
371
371
assert_type (s .str .rpartition (sep = ";" , expand = True ), pd .DataFrame ), pd .DataFrame
372
372
)
373
373
check (
374
- assert_type (s .str .rpartition (sep = ";" , expand = False ), "pd.Series[type[object]]" ),
375
- pd .Series ,
376
- object ,
377
- )
378
- check (
379
- assert_type (s .str .rpartition (expand = False ), "pd.Series[type[object]]" ),
374
+ assert_type (s .str .rpartition (sep = ";" , expand = False ), pd .Series ),
380
375
pd .Series ,
381
376
object ,
382
377
)
378
+ check (assert_type (s .str .rpartition (expand = False ), pd .Series ), pd .Series , object )
383
379
384
380
385
381
def test_index_overloads_partition ():
@@ -400,7 +396,7 @@ def test_index_overloads_partition():
400
396
pd .MultiIndex ,
401
397
)
402
398
check (
403
- assert_type (idx .str .partition (sep = ";" , expand = False ), " pd.Index[type[object]]" ),
399
+ assert_type (idx .str .partition (sep = ";" , expand = False ), pd .Index ),
404
400
pd .Index ,
405
401
object ,
406
402
)
@@ -411,9 +407,7 @@ def test_index_overloads_partition():
411
407
pd .MultiIndex ,
412
408
)
413
409
check (
414
- assert_type (
415
- idx .str .rpartition (sep = ";" , expand = False ), "pd.Index[type[object]]"
416
- ),
410
+ assert_type (idx .str .rpartition (sep = ";" , expand = False ), pd .Index ),
417
411
pd .Index ,
418
412
object ,
419
413
)
@@ -490,16 +484,12 @@ def test_series_overloads_extract():
490
484
assert_type (s .str .extract (r"[ab](\d)" , expand = True ), pd .DataFrame ), pd .DataFrame
491
485
)
492
486
check (
493
- assert_type (
494
- s .str .extract (r"[ab](\d)" , expand = False ), "pd.Series[type[object]]"
495
- ),
487
+ assert_type (s .str .extract (r"[ab](\d)" , expand = False ), pd .Series ),
496
488
pd .Series ,
497
489
object ,
498
490
)
499
491
check (
500
- assert_type (
501
- s .str .extract (r"[ab](\d)" , re .IGNORECASE , False ), "pd.Series[type[object]]"
502
- ),
492
+ assert_type (s .str .extract (r"[ab](\d)" , re .IGNORECASE , False ), pd .Series ),
503
493
pd .Series ,
504
494
object ,
505
495
)
@@ -513,16 +503,12 @@ def test_index_overloads_extract():
513
503
pd .DataFrame ,
514
504
)
515
505
check (
516
- assert_type (
517
- idx .str .extract (r"[ab](\d)" , expand = False ), "pd.Index[type[object]]"
518
- ),
506
+ assert_type (idx .str .extract (r"[ab](\d)" , expand = False ), pd .Index ),
519
507
pd .Index ,
520
508
object ,
521
509
)
522
510
check (
523
- assert_type (
524
- idx .str .extract (r"[ab](\d)" , re .IGNORECASE , False ), "pd.Index[type[object]]"
525
- ),
511
+ assert_type (idx .str .extract (r"[ab](\d)" , re .IGNORECASE , False ), pd .Index ),
526
512
pd .Index ,
527
513
object ,
528
514
)
0 commit comments