-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP: update mypy and small pyi fixes from ruff #54085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
729f53c
f104c0f
883f05e
c0f7b2b
3c7f072
09c1a09
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
Any, | ||
Callable, | ||
Literal, | ||
Union, | ||
cast, | ||
overload, | ||
) | ||
|
@@ -3459,7 +3458,7 @@ def sort_values( | |
self, | ||
*, | ||
axis: Axis = ..., | ||
ascending: bool | int | Sequence[bool] | Sequence[int] = ..., | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is undocumented (and incompatible with the declarations in NDFrame) - but it might work at runtime. |
||
ascending: bool | Sequence[bool] = ..., | ||
inplace: Literal[False] = ..., | ||
kind: SortKind = ..., | ||
na_position: NaPosition = ..., | ||
|
@@ -3473,7 +3472,7 @@ def sort_values( | |
self, | ||
*, | ||
axis: Axis = ..., | ||
ascending: bool | int | Sequence[bool] | Sequence[int] = ..., | ||
ascending: bool | Sequence[bool] = ..., | ||
inplace: Literal[True], | ||
kind: SortKind = ..., | ||
na_position: NaPosition = ..., | ||
|
@@ -3482,11 +3481,25 @@ def sort_values( | |
) -> None: | ||
... | ||
|
||
@overload | ||
def sort_values( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NDFrame declared this fallback overload, mypy seems to be stricter now and requires it also in the subclasses. |
||
self, | ||
*, | ||
axis: Axis = ..., | ||
ascending: bool | Sequence[bool] = ..., | ||
inplace: bool = ..., | ||
kind: SortKind = ..., | ||
na_position: NaPosition = ..., | ||
ignore_index: bool = ..., | ||
key: ValueKeyFunc = ..., | ||
) -> Series | None: | ||
... | ||
|
||
def sort_values( | ||
self, | ||
*, | ||
axis: Axis = 0, | ||
ascending: bool | int | Sequence[bool] | Sequence[int] = True, | ||
ascending: bool | Sequence[bool] = True, | ||
inplace: bool = False, | ||
kind: SortKind = "quicksort", | ||
na_position: NaPosition = "last", | ||
|
@@ -3647,7 +3660,7 @@ def sort_values( | |
) | ||
|
||
if is_list_like(ascending): | ||
ascending = cast(Sequence[Union[bool, int]], ascending) | ||
ascending = cast(Sequence[bool], ascending) | ||
if len(ascending) != 1: | ||
raise ValueError( | ||
f"Length of ascending ({len(ascending)}) must be 1 for Series" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ moto | |
flask | ||
asv>=0.5.1 | ||
flake8==6.0.0 | ||
mypy==1.2 | ||
mypy==1.4.1 | ||
tokenize-rt | ||
pre-commit>=2.15.0 | ||
gitpython | ||
|
Uh oh!
There was an error while loading. Please reload this page.