TYP: all and any shape-typing#31170
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Member
Author
|
The new But there are also some other errors. I looked into them, and they don't seem to indicate a problem on our side.
|
This comment has been minimized.
This comment has been minimized.
Member
|
Needs rebase. |
|
Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code: static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/type_blocks.py:2454: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/join.py:101: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/index_hierarchy.py:2423: error: Argument "condition" to "dropna" of "IndexHierarchy" has incompatible type overloaded function; expected "Callable[[ndarray[Any, Any]], ndarray[Any, Any]]" [arg-type]
+ static_frame/core/index_hierarchy.py:2796: error: Incompatible default for parameter "condition" (default has type overloaded function, parameter has type "Callable[[ndarray[Any, Any]], ndarray[Any, Any]]") [assignment]
+ static_frame/core/index_hierarchy.py:2810: error: Incompatible default for parameter "condition" (default has type overloaded function, parameter has type "Callable[[ndarray[Any, Any]], ndarray[Any, Any]]") [assignment]
+ static_frame/core/frame.py:4885: error: Incompatible default for parameter "condition" (default has type overloaded function, parameter has type "Callable[[ndarray[Any, Any]], ndarray[Any, Any]]") [assignment]
+ static_frame/core/frame.py:4945: error: Incompatible default for parameter "condition" (default has type overloaded function, parameter has type "Callable[[ndarray[Any, Any]], ndarray[Any, Any]]") [assignment]
+ static_frame/core/store_xlsx.py:487: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/store_xlsx.py:496: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/batch.py:1158: error: Incompatible default for parameter "condition" (default has type overloaded function, parameter has type "Callable[[ndarray[Any, Any]], builtins.bool]") [assignment]
+ static_frame/core/batch.py:1187: error: Incompatible default for parameter "condition" (default has type overloaded function, parameter has type "Callable[[ndarray[Any, Any]], builtins.bool]") [assignment]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/missing.py:262: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/io/formats/format.py:1249: error: No overload variant of "__rand__" of "ndarray" matches argument type "ExtensionArray" [operator]
+ pandas/io/formats/format.py:1249: note: Possible overload variants:
+ pandas/io/formats/format.py:1249: note: def __rand__(self, _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool], /) -> ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]
+ pandas/io/formats/format.py:1249: note: def __rand__(self, _SupportsArray[dtype[numpy.bool[builtins.bool] | unsignedinteger[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | unsignedinteger[Any]]]] | builtins.bool | _NestedSequence[builtins.bool], /) -> ndarray[tuple[Any, ...], dtype[unsignedinteger[Any]]]
+ pandas/io/formats/format.py:1249: note: def __rand__(self, _SupportsArray[dtype[numpy.bool[builtins.bool] | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | integer[Any]]]] | int | _NestedSequence[int], /) -> ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]
+ pandas/io/formats/format.py:1249: note: def __rand__(self, _SupportsArray[dtype[object_]] | _NestedSequence[_SupportsArray[dtype[object_]]], /) -> Any
+ pandas/io/formats/format.py:1249: note: Both left and right operands are unions
+ pandas/io/formats/format.py:1255: error: Incompatible types in assignment (expression has type "Any | numpy.bool[builtins.bool]", variable has type "builtins.bool | None") [assignment]
|
Member
|
Thanks Joren. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
np.any,np.all, and the correspondingndarraymethods will now return the same input shape whenkeepdims=True, and will no longer returnAnyin caseaxisis notNone.AI Disclosure
N/A