@@ -436,17 +436,20 @@ def test_hasnans_isnans(self, index_flat):
436
436
tm .assert_numpy_array_equal (idx ._isnan , expected )
437
437
assert idx .hasnans is True
438
438
439
+
439
440
@pytest .mark .filterwarnings (r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning" )
440
441
@pytest .mark .parametrize ("na_position" , [None , "middle" ])
441
442
def test_sort_values_invalid_na_position (index_with_missing , na_position ):
442
443
non_na_values = [x for x in index_with_missing if pd .notna (x )]
443
444
if len ({type (x ) for x in non_na_values }) > 1 :
444
445
pytest .mark .xfail (
445
- reason = "Sorting fails due to heterogeneous types in index (int vs str)" )
446
+ reason = "Sorting fails due to heterogeneous types in index (int vs str)"
447
+ )
446
448
447
449
with pytest .raises (ValueError , match = f"invalid na_position: { na_position } " ):
448
450
index_with_missing .sort_values (na_position = na_position )
449
451
452
+
450
453
@pytest .mark .filterwarnings (r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning" )
451
454
@pytest .mark .parametrize ("na_position" , ["first" , "last" ])
452
455
def test_sort_values_with_missing (index_with_missing , na_position , request ):
@@ -456,7 +459,8 @@ def test_sort_values_with_missing(index_with_missing, na_position, request):
456
459
non_na_values = [x for x in index_with_missing if pd .notna (x )]
457
460
if len ({type (x ) for x in non_na_values }) > 1 :
458
461
pytest .mark .xfail (
459
- reason = "Sorting fails due to heterogeneous types in index (int vs str)" )
462
+ reason = "Sorting fails due to heterogeneous types in index (int vs str)"
463
+ )
460
464
461
465
if isinstance (index_with_missing , CategoricalIndex ):
462
466
request .applymarker (
0 commit comments