Skip to content

Commit 52e2289

Browse files
authored
add: type hints to sort_values (#52720)
* add: type hints to sort_values * update: type hint for super class
1 parent 561bcea commit 52e2289

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

pandas/core/generic.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -4852,8 +4852,8 @@ def sort_values(
48524852
axis: Axis = ...,
48534853
ascending: bool_t | Sequence[bool_t] = ...,
48544854
inplace: Literal[False] = ...,
4855-
kind: str = ...,
4856-
na_position: str = ...,
4855+
kind: SortKind = ...,
4856+
na_position: NaPosition = ...,
48574857
ignore_index: bool_t = ...,
48584858
key: ValueKeyFunc = ...,
48594859
) -> Self:
@@ -4866,8 +4866,8 @@ def sort_values(
48664866
axis: Axis = ...,
48674867
ascending: bool_t | Sequence[bool_t] = ...,
48684868
inplace: Literal[True],
4869-
kind: str = ...,
4870-
na_position: str = ...,
4869+
kind: SortKind = ...,
4870+
na_position: NaPosition = ...,
48714871
ignore_index: bool_t = ...,
48724872
key: ValueKeyFunc = ...,
48734873
) -> None:
@@ -4880,8 +4880,8 @@ def sort_values(
48804880
axis: Axis = ...,
48814881
ascending: bool_t | Sequence[bool_t] = ...,
48824882
inplace: bool_t = ...,
4883-
kind: str = ...,
4884-
na_position: str = ...,
4883+
kind: SortKind = ...,
4884+
na_position: NaPosition = ...,
48854885
ignore_index: bool_t = ...,
48864886
key: ValueKeyFunc = ...,
48874887
) -> Self | None:
@@ -4893,8 +4893,8 @@ def sort_values(
48934893
axis: Axis = 0,
48944894
ascending: bool_t | Sequence[bool_t] = True,
48954895
inplace: bool_t = False,
4896-
kind: str = "quicksort",
4897-
na_position: str = "last",
4896+
kind: SortKind = "quicksort",
4897+
na_position: NaPosition = "last",
48984898
ignore_index: bool_t = False,
48994899
key: ValueKeyFunc = None,
49004900
) -> Self | None:

pandas/core/series.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -3334,8 +3334,8 @@ def sort_values(
33343334
axis: Axis = ...,
33353335
ascending: bool | int | Sequence[bool] | Sequence[int] = ...,
33363336
inplace: Literal[False] = ...,
3337-
kind: str = ...,
3338-
na_position: str = ...,
3337+
kind: SortKind = ...,
3338+
na_position: NaPosition = ...,
33393339
ignore_index: bool = ...,
33403340
key: ValueKeyFunc = ...,
33413341
) -> Series:
@@ -3348,8 +3348,8 @@ def sort_values(
33483348
axis: Axis = ...,
33493349
ascending: bool | int | Sequence[bool] | Sequence[int] = ...,
33503350
inplace: Literal[True],
3351-
kind: str = ...,
3352-
na_position: str = ...,
3351+
kind: SortKind = ...,
3352+
na_position: NaPosition = ...,
33533353
ignore_index: bool = ...,
33543354
key: ValueKeyFunc = ...,
33553355
) -> None:
@@ -3361,8 +3361,8 @@ def sort_values(
33613361
axis: Axis = 0,
33623362
ascending: bool | int | Sequence[bool] | Sequence[int] = True,
33633363
inplace: bool = False,
3364-
kind: str = "quicksort",
3365-
na_position: str = "last",
3364+
kind: SortKind = "quicksort",
3365+
na_position: NaPosition = "last",
33663366
ignore_index: bool = False,
33673367
key: ValueKeyFunc = None,
33683368
) -> Series | None:

0 commit comments

Comments
 (0)