18
18
Any ,
19
19
Callable ,
20
20
Literal ,
21
- Union ,
22
21
cast ,
23
22
overload ,
24
23
)
@@ -3459,7 +3458,7 @@ def sort_values(
3459
3458
self ,
3460
3459
* ,
3461
3460
axis : Axis = ...,
3462
- ascending : bool | int | Sequence [bool ] | Sequence [ int ] = ...,
3461
+ ascending : bool | Sequence [bool ] = ...,
3463
3462
inplace : Literal [False ] = ...,
3464
3463
kind : SortKind = ...,
3465
3464
na_position : NaPosition = ...,
@@ -3473,7 +3472,7 @@ def sort_values(
3473
3472
self ,
3474
3473
* ,
3475
3474
axis : Axis = ...,
3476
- ascending : bool | int | Sequence [bool ] | Sequence [ int ] = ...,
3475
+ ascending : bool | Sequence [bool ] = ...,
3477
3476
inplace : Literal [True ],
3478
3477
kind : SortKind = ...,
3479
3478
na_position : NaPosition = ...,
@@ -3482,11 +3481,25 @@ def sort_values(
3482
3481
) -> None :
3483
3482
...
3484
3483
3484
+ @overload
3485
+ def sort_values (
3486
+ self ,
3487
+ * ,
3488
+ axis : Axis = ...,
3489
+ ascending : bool | Sequence [bool ] = ...,
3490
+ inplace : bool = ...,
3491
+ kind : SortKind = ...,
3492
+ na_position : NaPosition = ...,
3493
+ ignore_index : bool = ...,
3494
+ key : ValueKeyFunc = ...,
3495
+ ) -> Series | None :
3496
+ ...
3497
+
3485
3498
def sort_values (
3486
3499
self ,
3487
3500
* ,
3488
3501
axis : Axis = 0 ,
3489
- ascending : bool | int | Sequence [bool ] | Sequence [ int ] = True ,
3502
+ ascending : bool | Sequence [bool ] = True ,
3490
3503
inplace : bool = False ,
3491
3504
kind : SortKind = "quicksort" ,
3492
3505
na_position : NaPosition = "last" ,
@@ -3647,7 +3660,7 @@ def sort_values(
3647
3660
)
3648
3661
3649
3662
if is_list_like (ascending ):
3650
- ascending = cast (Sequence [Union [ bool , int ] ], ascending )
3663
+ ascending = cast (Sequence [bool ], ascending )
3651
3664
if len (ascending ) != 1 :
3652
3665
raise ValueError (
3653
3666
f"Length of ascending ({ len (ascending )} ) must be 1 for Series"
0 commit comments