@@ -464,7 +464,9 @@ def test_sort_values_invalid_na_position(
464
464
reason = "Sorting fails due to heterogeneous types in index (int vs str)" ,
465
465
strict = False ,
466
466
)
467
- def test_sort_values_with_missing (index_with_missing , na_position , request , box_in_series ):
467
+ def test_sort_values_with_missing (
468
+ index_with_missing , na_position , request , box_in_series
469
+ ):
468
470
# GH 35584. Test that sort_values works with missing values,
469
471
# sort non-missing and place missing according to na_position
470
472
@@ -489,7 +491,6 @@ def test_sort_values_with_missing(index_with_missing, na_position, request, box_
489
491
else :
490
492
not_na_vals = index_with_missing [index_with_missing .notna ()].values
491
493
492
-
493
494
sorted_values = np .sort (not_na_vals )
494
495
if na_position == "first" :
495
496
sorted_values = np .concatenate ([[None ] * missing_count , sorted_values ])
@@ -500,7 +501,9 @@ def test_sort_values_with_missing(index_with_missing, na_position, request, box_
500
501
if isinstance (index_with_missing , pd .Series ):
501
502
expected = pd .Series (sorted_values , dtype = index_with_missing .dtype )
502
503
else :
503
- expected = type (index_with_missing )(sorted_values , dtype = index_with_missing .dtype )
504
+ expected = type (index_with_missing )(
505
+ sorted_values , dtype = index_with_missing .dtype
506
+ )
504
507
505
508
result = index_with_missing .sort_values (na_position = na_position )
506
509
if isinstance (index_with_missing , pd .Series ):
0 commit comments