TYP: Gradual shape type defaults#28982
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Member
Author
|
mypy primer is looking pretty good in general |
e190d6c to
a16ef8c
Compare
|
Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code: hydpy (https://github.com/hydpy-dev/hydpy)
- hydpy/core/testtools.py:1516: error: Incompatible return value type (got "dict[ModelSequence, ndarray[tuple[int, int], dtype[float64]]]", expected "dict[ModelSequence, ndarray[tuple[int, ...], dtype[float64]]]") [return-value]
- hydpy/core/testtools.py:1516: note: "Dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
- hydpy/core/testtools.py:1516: note: Consider using "Mapping" instead, which is covariant in the value type
- hydpy/core/testtools.py:1516: note: Perhaps you need a type annotation for "yvalues"? Suggestion: "dict[ModelSequence, ndarray[tuple[int, ...], dtype[float64]]]"
+ hydpy/core/objecttools.py:955: error: Argument 1 to "repr_values" has incompatible type "Sequence[object] | ndarray[tuple[Any, ...], dtype[generic[Any]]] | generic[Any]"; expected "Sequence[object] | ndarray[tuple[Any, ...], dtype[generic[Any]]]" [arg-type]
+ hydpy/core/netcdftools.py:489: error: Argument 1 to "join" of "bytes" has incompatible type "bytes_"; expected "Iterable[Buffer]" [arg-type]
+ hydpy/core/netcdftools.py:489: note: Following member(s) of "bytes_" have conflicts:
+ hydpy/core/netcdftools.py:489: note: Expected:
+ hydpy/core/netcdftools.py:489: note: def __iter__(self) -> Iterator[Buffer]
+ hydpy/core/netcdftools.py:489: note: Got:
+ hydpy/core/netcdftools.py:489: note: def __iter__(self) -> Iterator[int]
+ hydpy/core/netcdftools.py:489: note: Expected:
+ hydpy/core/netcdftools.py:489: note: def __iter__(self) -> Iterator[Buffer]
+ hydpy/core/netcdftools.py:489: note: Got:
+ hydpy/core/netcdftools.py:489: note: def __iter__(self) -> Iterator[int]
+ hydpy/core/netcdftools.py:489: note: Expected:
+ hydpy/core/netcdftools.py:489: note: def __iter__(self) -> Iterator[Buffer]
+ hydpy/core/netcdftools.py:489: note: Got:
+ hydpy/core/netcdftools.py:489: note: def __iter__(self) -> Iterator[int]
- hydpy/core/itemtools.py:951: error: Argument 2 to "update_variable" of "ChangeItem" has incompatible type "float64"; expected "ndarray[tuple[int, ...], dtype[float64]]" [arg-type]
+ hydpy/core/itemtools.py:951: error: Argument 2 to "update_variable" of "ChangeItem" has incompatible type "float64"; expected "ndarray[tuple[Any, ...], dtype[float64]]" [arg-type]
- hydpy/core/itemtools.py:954: error: Argument 2 to "update_variable" of "ChangeItem" has incompatible type "float64"; expected "ndarray[tuple[int, ...], dtype[float64]]" [arg-type]
+ hydpy/core/itemtools.py:954: error: Argument 2 to "update_variable" of "ChangeItem" has incompatible type "float64"; expected "ndarray[tuple[Any, ...], dtype[float64]]" [arg-type]
- hydpy/auxs/statstools.py:298: error: Argument "sim" to "SimObs" has incompatible type "Series[Any]"; expected "ndarray[tuple[int, ...], dtype[float64]]" [arg-type]
+ hydpy/auxs/statstools.py:298: error: Argument "sim" to "SimObs" has incompatible type "Series[Any]"; expected "ndarray[tuple[Any, ...], dtype[float64]]" [arg-type]
- hydpy/auxs/statstools.py:298: error: Argument "obs" to "SimObs" has incompatible type "Series[Any]"; expected "ndarray[tuple[int, ...], dtype[float64]]" [arg-type]
+ hydpy/auxs/statstools.py:298: error: Argument "obs" to "SimObs" has incompatible type "Series[Any]"; expected "ndarray[tuple[Any, ...], dtype[float64]]" [arg-type]
- hydpy/auxs/ppolytools.py:256: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, signedinteger[_64Bit]], dtype[float64]]", variable has type "Sequence[Sequence[float] | ndarray[tuple[int, ...], dtype[float64]]] | ndarray[tuple[int, ...], dtype[float64]]") [assignment]
- hydpy/auxs/ppolytools.py:423: error: No overload variant of "CubicHermiteSpline" matches argument types "ndarray[tuple[int, ...], dtype[float64]]", "ndarray[tuple[int, ...], dtype[float64]]" [call-overload]
+ hydpy/auxs/ppolytools.py:423: error: No overload variant of "CubicHermiteSpline" matches argument types "ndarray[tuple[Any, ...], dtype[float64]]", "ndarray[tuple[Any, ...], dtype[float64]]" [call-overload]
- hydpy/auxs/ppolytools.py:427: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[signedinteger[_64Bit]]]", variable has type "ndarray[tuple[int], dtype[signedinteger[_64Bit]]]") [assignment]
- hydpy/auxs/armatools.py:258: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[float64]]") [assignment]
- hydpy/models/rconc/rconc_control.py:422: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], Any]", variable has type "ndarray[tuple[int], dtype[floating[Any]]]") [assignment]
freqtrade (https://github.com/freqtrade/freqtrade)
- freqtrade/data/metrics.py:122: error: Invalid index type "tuple[Hashable, str]" for "_LocIndexerFrame[DataFrame]"; expected type "Series[builtins.bool] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]] | list[builtins.bool] | str | str_ | <9 more items>" [index]
+ freqtrade/data/metrics.py:122: error: Invalid index type "tuple[Hashable, str]" for "_LocIndexerFrame[DataFrame]"; expected type "Series[builtins.bool] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | list[builtins.bool] | str | str_ | <9 more items>" [index]
- freqtrade/data/entryexitanalysis.py:59: error: Invalid index type "tuple[Hashable, str]" for "_LocIndexerFrame[DataFrame]"; expected type "Series[builtins.bool] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]] | list[builtins.bool] | str | str_ | <9 more items>" [index]
+ freqtrade/data/entryexitanalysis.py:59: error: Invalid index type "tuple[Hashable, str]" for "_LocIndexerFrame[DataFrame]"; expected type "Series[builtins.bool] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | list[builtins.bool] | str | str_ | <9 more items>" [index]
- freqtrade/data/entryexitanalysis.py:60: error: Invalid index type "tuple[Hashable, str]" for "_LocIndexerFrame[DataFrame]"; expected type "Series[builtins.bool] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]] | list[builtins.bool] | str | str_ | <9 more items>" [index]
+ freqtrade/data/entryexitanalysis.py:60: error: Invalid index type "tuple[Hashable, str]" for "_LocIndexerFrame[DataFrame]"; expected type "Series[builtins.bool] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | list[builtins.bool] | str | str_ | <9 more items>" [index]
- freqtrade/data/entryexitanalysis.py:60: error: Invalid index type "tuple[Hashable, str]" for "_LocIndexerFrame[DataFrame]"; expected type "slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | <6 more items>" [index]
+ freqtrade/data/entryexitanalysis.py:60: error: Invalid index type "tuple[Hashable, str]" for "_LocIndexerFrame[DataFrame]"; expected type "slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | <6 more items>" [index]
- freqtrade/plot/plotting.py:187: error: Invalid index type "tuple[datetime, str]" for "_LocIndexerFrame[DataFrame]"; expected type "slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | <6 more items>" [index]
+ freqtrade/plot/plotting.py:187: error: Invalid index type "tuple[datetime, str]" for "_LocIndexerFrame[DataFrame]"; expected type "slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | <6 more items>" [index]
- freqtrade/plot/plotting.py:188: error: Invalid index type "tuple[datetime, str]" for "_LocIndexerFrame[DataFrame]"; expected type "slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | <6 more items>" [index]
+ freqtrade/plot/plotting.py:188: error: Invalid index type "tuple[datetime, str]" for "_LocIndexerFrame[DataFrame]"; expected type "slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | <6 more items>" [index]
- freqtrade/freqai/data_drawer.py:363: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
+ freqtrade/freqai/data_drawer.py:363: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
- freqtrade/freqai/data_drawer.py:363: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "tuple[int, int]" [index]
+ freqtrade/freqai/data_drawer.py:363: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "tuple[int, int]" [index]
- freqtrade/freqai/data_drawer.py:368: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
+ freqtrade/freqai/data_drawer.py:368: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
- freqtrade/freqai/data_drawer.py:369: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
+ freqtrade/freqai/data_drawer.py:369: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
- freqtrade/freqai/data_drawer.py:373: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
+ freqtrade/freqai/data_drawer.py:373: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
- freqtrade/freqai/data_drawer.py:376: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
+ freqtrade/freqai/data_drawer.py:376: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
- freqtrade/freqai/data_drawer.py:383: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
+ freqtrade/freqai/data_drawer.py:383: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
- freqtrade/freqai/data_drawer.py:387: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
+ freqtrade/freqai/data_drawer.py:387: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int] | tuple[int, int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], int] | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int], slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]] | tuple[int, slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | list[int] | Series[int]]" [index]
- freqtrade/freqai/data_drawer.py:387: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "tuple[int, int]" [index]
+ freqtrade/freqai/data_drawer.py:387: error: Invalid index type "tuple[int, int | slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]]" for "_iLocIndexerFrame[DataFrame]"; expected type "tuple[int, int]" [index]
... (truncated 28 lines) ...
AutoSplit (https://github.com/Toufool/AutoSplit)
- src/capture_method/XcbCaptureMethod.py:58:17: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "Image") [assignment]
+ src/capture_method/XcbCaptureMethod.py:58:17: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[Any]]", variable has type "Image") [assignment]
- src/capture_method/ScrotCaptureMethod.py:48:17: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "Image") [assignment]
+ src/capture_method/ScrotCaptureMethod.py:48:17: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[Any]]", variable has type "Image") [assignment]
xarray (https://github.com/pydata/xarray)
- xarray/core/indexing.py:1152: error: Argument 1 to "append" of "list" has incompatible type "ndarray[tuple[int, ...], dtype[Any]]"; expected "slice[Any, Any, Any]" [arg-type]
+ xarray/core/indexing.py:1152: error: Argument 1 to "append" of "list" has incompatible type "ndarray[tuple[Any, ...], dtype[Any]]"; expected "slice[Any, Any, Any]" [arg-type]
- xarray/tests/test_parallelcompat.py:93: error: Return type "tuple[ndarray[tuple[int, ...], dtype[Any]], ...]" of "compute" incompatible with return type "tuple[ndarray[Any, _DType_co], ...]" in supertype "ChunkManagerEntrypoint" [override]
+ xarray/tests/test_parallelcompat.py:93: error: Return type "tuple[ndarray[tuple[Any, ...], dtype[Any]], ...]" of "compute" incompatible with return type "tuple[ndarray[Any, _DType_co], ...]" in supertype "ChunkManagerEntrypoint" [override]
- xarray/tests/test_dataarray.py:3810: error: Argument 1 to "len" has incompatible type "ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]] | numpy.bool[builtins.bool]"; expected "Sized" [arg-type]
+ xarray/tests/test_dataarray.py:3810: error: Argument 1 to "len" has incompatible type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | numpy.bool[builtins.bool]"; expected "Sized" [arg-type]
dedupe (https://github.com/dedupeio/dedupe)
+ dedupe/clustering.py:59: error: Incompatible types in assignment (expression has type "signedinteger[_64Bit]", variable has type "int") [assignment]
+ dedupe/labeler.py:199: error: Generator has incompatible item type "tuple[int | str, int | str]"; expected "tuple[int, int] | tuple[str, str]" [misc]
- dedupe/datamodel.py:122: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[Any]]") [assignment]
- dedupe/convenience.py:43: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[signedinteger[Any]]]") [assignment]
- dedupe/convenience.py:73: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[signedinteger[Any]]]", variable has type "ndarray[tuple[int], dtype[signedinteger[Any]]]") [assignment]
+ dedupe/convenience.py:99: error: "signedinteger[_64Bit]" object is not iterable [misc]
+ dedupe/convenience.py:99: error: Cannot determine type of "p" [has-type]
+ dedupe/convenience.py:99: error: Cannot determine type of "q" [has-type]
optuna (https://github.com/optuna/optuna)
- optuna/_hypervolume/hssp.py:108: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[signedinteger[Any]]]", variable has type "ndarray[tuple[int], dtype[signedinteger[Any]]]") [assignment]
- optuna/_hypervolume/box_decomposition.py:92: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int, int], dtype[Any]]") [assignment]
- tests/hypervolume_tests/test_wfg.py:26: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int], dtype[Any]]") [assignment]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/arrow/_arrow_utils.py:47: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/_numba/executor.py:90: error: Incompatible redefinition (redefinition with type "Callable[[ndarray[tuple[Any, ...], dtype[Any]], ndarray[tuple[Any, ...], dtype[Any]], ndarray[tuple[Any, ...], dtype[Any]], int, VarArg(Any)], Any]", original type "Callable[[ndarray[tuple[Any, ...], dtype[Any]], ndarray[tuple[Any, ...], dtype[Any]], int, int, VarArg(Any)], Any]") [misc]
- pandas/core/window/numba_.py:238: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int], dtype[float64]]") [assignment]
- pandas/core/_numba/executor.py:90: error: Incompatible redefinition (redefinition with type "Callable[[ndarray[tuple[int, ...], dtype[Any]], ndarray[tuple[int, ...], dtype[Any]], ndarray[tuple[int, ...], dtype[Any]], int, VarArg(Any)], Any]", original type "Callable[[ndarray[tuple[int, ...], dtype[Any]], ndarray[tuple[int, ...], dtype[Any]], int, int, VarArg(Any)], Any]") [misc]
+ pandas/core/array_algos/quantile.py:105: error: Unused "type: ignore" comment [unused-ignore]
- pandas/core/construction.py:687: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[Any]]") [assignment]
- pandas/core/construction.py:689: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[Any]]") [assignment]
+ pandas/tseries/frequencies.py:274: error: List comprehension has incompatible type List[floating[_64Bit]]; expected List[int] [misc]
+ pandas/tseries/frequencies.py:279: error: List comprehension has incompatible type List[floating[_64Bit]]; expected List[int] [misc]
+ pandas/core/arrays/arrow/array.py:2543: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/arrays/datetimelike.py:1293: error: No overload variant of "__mul__" of "BaseOffset" matches argument type "signedinteger[_64Bit]" [operator]
+ pandas/core/arrays/datetimelike.py:1293: note: Possible overload variants:
+ pandas/core/arrays/datetimelike.py:1293: note: def __mul__(self, ndarray[tuple[Any, ...], dtype[Any]], /) -> ndarray[tuple[Any, ...], dtype[Any]]
+ pandas/core/arrays/datetimelike.py:1293: note: def __mul__(self, int, /) -> BaseOffset
- pandas/core/arrays/categorical.py:1858: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[signedinteger[Any]]]") [assignment]
+ pandas/core/arrays/categorical.py:1856: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/io/stata.py:1448: error: Invalid index type "unsignedinteger[_8Bit]" for "dict[int, int]"; expected type "int" [index]
+ pandas/io/stata.py:1450: error: Argument 1 to "append" of "list" has incompatible type "unsignedinteger[_8Bit]"; expected "int" [arg-type]
- pandas/core/frame.py:11368: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]") [assignment]
- pandas/core/reshape/concat.py:936: error: Generator has incompatible item type "ndarray[tuple[int, ...], dtype[Any]]"; expected "ndarray[tuple[int], dtype[Any]]" [misc]
- pandas/core/reshape/concat.py:940: error: Argument 1 to "append" of "list" has incompatible type "ndarray[tuple[int, ...], dtype[Any]]"; expected "ndarray[tuple[int], dtype[Any]]" [arg-type]
+ pandas/core/reshape/encoding.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/internals/managers.py:1527: error: "BlockPlacement" has no attribute "increment_above" [attr-defined]
+ pandas/core/indexers/objects.py:134: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexers/objects.py:135: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexers/objects.py:405: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexers/objects.py:491: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/groupby/groupby.py:1888: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/io/formats/style_render.py:1243: error: Invalid index type "tuple[signedinteger[_32Bit | _64Bit], signedinteger[_32Bit | _64Bit]]" for "defaultdict[tuple[int, int], Callable[[Any], str]]"; expected type "tuple[int, int]" [index]
scipy (https://github.com/scipy/scipy)
+ scipy/optimize/_isotonic.py:147: error: Unused "type: ignore" comment [unused-ignore]
- scipy/spatial/tests/test_spherical_voronoi.py:255: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "list[ndarray[tuple[int, ...], dtype[Any]]]") [assignment]
+ scipy/spatial/tests/test_spherical_voronoi.py:255: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[Any]]", variable has type "list[ndarray[tuple[Any, ...], dtype[Any]]]") [assignment]
spark (https://github.com/apache/spark)
- python/pyspark/sql/pandas/types.py:633: error: Argument "ambiguous" to "tz_localize" of "_DatetimeLikeNoTZMethods" has incompatible type "Literal[False]"; expected "Literal['raise', 'infer', 'NaT'] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]]" [arg-type]
+ python/pyspark/sql/pandas/types.py:633: error: Argument "ambiguous" to "tz_localize" of "_DatetimeLikeNoTZMethods" has incompatible type "Literal[False]"; expected "Literal['raise', 'infer', 'NaT'] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]" [arg-type]
+ python/pyspark/sql/pandas/conversion.py:621: error: Argument 1 to "len" has incompatible type "dtype[Any]"; expected "Sized" [arg-type]
+ python/pyspark/sql/pandas/conversion.py:627: error: Incompatible types in assignment (expression has type "str", variable has type "dtype[Any]") [assignment]
+ python/pyspark/sql/pandas/conversion.py:629: error: Value of type "tuple[str, ...] | None" is not indexable [index]
- python/pyspark/pandas/namespace.py:1139: note: def [IntStrT: (int, str)] read_excel(io: str | PathLike[str] | ReadBuffer[bytes] | ExcelFile | Any | Any | Any | Any, sheet_name: list[IntStrT], *, header: int | Sequence[int] | None = ..., names: MutableSequence[Any] | ndarray[tuple[int, ...], dtype[Any]] | tuple[Any, ...] | range | None = ..., index_col: int | Sequence[int] | str | None = ..., usecols: str | SequenceNotStr[Hashable] | range | ExtensionArray | ndarray[Any, Any] | Index[Any] | Series[Any] | Callable[[Any], bool] | None = ..., dtype: str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object] | Mapping[str, str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object]] | None = ..., engine: Literal['xlrd', 'openpyxl', 'odf', 'pyxlsb', 'calamine'] | None = ..., converters: Mapping[int | str, Callable[[object], object]] | None = ..., true_values: Iterable[Hashable] | None = ..., false_values: Iterable[Hashable] | None = ..., skiprows: int | Sequence[int] | Callable[[object], bool] | None = ..., nrows: int | None = ..., na_values: Sequence[str] | dict[str | int, Sequence[str]] = ..., keep_default_na: bool = ..., na_filter: bool = ..., verbose: bool = ..., parse_dates: bool | Sequence[int] | Sequence[Sequence[str] | Sequence[int]] | dict[str, Sequence[int] | list[str]] = ..., date_format: dict[Hashable, str] | str | None = ..., thousands: str | None = ..., decimal: str = ..., comment: str | None = ..., skipfooter: int = ..., storage_options: dict[str, Any] | None = ..., dtype_backend: Literal['pyarrow', 'numpy_nullable'] | Literal[_NoDefault.no_default] = ...) -> dict[IntStrT, DataFrame]
+ python/pyspark/pandas/namespace.py:1139: note: def [IntStrT: (int, str)] read_excel(io: str | PathLike[str] | ReadBuffer[bytes] | ExcelFile | Any | Any | Any | Any, sheet_name: list[IntStrT], *, header: int | Sequence[int] | None = ..., names: MutableSequence[Any] | ndarray[tuple[Any, ...], dtype[Any]] | tuple[Any, ...] | range | None = ..., index_col: int | Sequence[int] | str | None = ..., usecols: str | SequenceNotStr[Hashable] | range | ExtensionArray | ndarray[Any, Any] | Index[Any] | Series[Any] | Callable[[Any], bool] | None = ..., dtype: str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object] | Mapping[str, str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object]] | None = ..., engine: Literal['xlrd', 'openpyxl', 'odf', 'pyxlsb', 'calamine'] | None = ..., converters: Mapping[int | str, Callable[[object], object]] | None = ..., true_values: Iterable[Hashable] | None = ..., false_values: Iterable[Hashable] | None = ..., skiprows: int | Sequence[int] | Callable[[object], bool] | None = ..., nrows: int | None = ..., na_values: Sequence[str] | dict[str | int, Sequence[str]] = ..., keep_default_na: bool = ..., na_filter: bool = ..., verbose: bool = ..., parse_dates: bool | Sequence[int] | Sequence[Sequence[str] | Sequence[int]] | dict[str, Sequence[int] | list[str]] = ..., date_format: dict[Hashable, str] | str | None = ..., thousands: str | None = ..., decimal: str = ..., comment: str | None = ..., skipfooter: int = ..., storage_options: dict[str, Any] | None = ..., dtype_backend: Literal['pyarrow', 'numpy_nullable'] | Literal[_NoDefault.no_default] = ...) -> dict[IntStrT, DataFrame]
- python/pyspark/pandas/namespace.py:1139: note: def read_excel(io: str | PathLike[str] | ReadBuffer[bytes] | ExcelFile | Any | Any | Any | Any, sheet_name: None, *, header: int | Sequence[int] | None = ..., names: MutableSequence[Any] | ndarray[tuple[int, ...], dtype[Any]] | tuple[Any, ...] | range | None = ..., index_col: int | Sequence[int] | str | None = ..., usecols: str | SequenceNotStr[Hashable] | range | ExtensionArray | ndarray[Any, Any] | Index[Any] | Series[Any] | Callable[[Any], bool] | None = ..., dtype: str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object] | Mapping[str, str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object]] | None = ..., engine: Literal['xlrd', 'openpyxl', 'odf', 'pyxlsb', 'calamine'] | None = ..., converters: Mapping[int | str, Callable[[object], object]] | None = ..., true_values: Iterable[Hashable] | None = ..., false_values: Iterable[Hashable] | None = ..., skiprows: int | Sequence[int] | Callable[[object], bool] | None = ..., nrows: int | None = ..., na_values: Sequence[str] | dict[str | int, Sequence[str]] = ..., keep_default_na: bool = ..., na_filter: bool = ..., verbose: bool = ..., parse_dates: bool | Sequence[int] | Sequence[Sequence[str] | Sequence[int]] | dict[str, Sequence[int] | list[str]] = ..., date_format: dict[Hashable, str] | str | None = ..., thousands: str | None = ..., decimal: str = ..., comment: str | None = ..., skipfooter: int = ..., storage_options: dict[str, Any] | None = ..., dtype_backend: Literal['pyarrow', 'numpy_nullable'] | Literal[_NoDefault.no_default] = ...) -> dict[str, DataFrame]
+ python/pyspark/pandas/namespace.py:1139: note: def read_excel(io: str | PathLike[str] | ReadBuffer[bytes] | ExcelFile | Any | Any | Any | Any, sheet_name: None, *, header: int | Sequence[int] | None = ..., names: MutableSequence[Any] | ndarray[tuple[Any, ...], dtype[Any]] | tuple[Any, ...] | range | None = ..., index_col: int | Sequence[int] | str | None = ..., usecols: str | SequenceNotStr[Hashable] | range | ExtensionArray | ndarray[Any, Any] | Index[Any] | Series[Any] | Callable[[Any], bool] | None = ..., dtype: str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object] | Mapping[str, str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object]] | None = ..., engine: Literal['xlrd', 'openpyxl', 'odf', 'pyxlsb', 'calamine'] | None = ..., converters: Mapping[int | str, Callable[[object], object]] | None = ..., true_values: Iterable[Hashable] | None = ..., false_values: Iterable[Hashable] | None = ..., skiprows: int | Sequence[int] | Callable[[object], bool] | None = ..., nrows: int | None = ..., na_values: Sequence[str] | dict[str | int, Sequence[str]] = ..., keep_default_na: bool = ..., na_filter: bool = ..., verbose: bool = ..., parse_dates: bool | Sequence[int] | Sequence[Sequence[str] | Sequence[int]] | dict[str, Sequence[int] | list[str]] = ..., date_format: dict[Hashable, str] | str | None = ..., thousands: str | None = ..., decimal: str = ..., comment: str | None = ..., skipfooter: int = ..., storage_options: dict[str, Any] | None = ..., dtype_backend: Literal['pyarrow', 'numpy_nullable'] | Literal[_NoDefault.no_default] = ...) -> dict[str, DataFrame]
- python/pyspark/pandas/namespace.py:1139: note: def read_excel(io: str | PathLike[str] | ReadBuffer[bytes] | ExcelFile | Any | Any | Any | Any, sheet_name: list[int | str], *, header: int | Sequence[int] | None = ..., names: MutableSequence[Any] | ndarray[tuple[int, ...], dtype[Any]] | tuple[Any, ...] | range | None = ..., index_col: int | Sequence[int] | str | None = ..., usecols: str | SequenceNotStr[Hashable] | range | ExtensionArray | ndarray[Any, Any] | Index[Any] | Series[Any] | Callable[[Any], bool] | None = ..., dtype: str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object] | Mapping[str, str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object]] | None = ..., engine: Literal['xlrd', 'openpyxl', 'odf', 'pyxlsb', 'calamine'] | None = ..., converters: Mapping[int | str, Callable[[object], object]] | None = ..., true_values: Iterable[Hashable] | None = ..., false_values: Iterable[Hashable] | None = ..., skiprows: int | Sequence[int] | Callable[[object], bool] | None = ..., nrows: int | None = ..., na_values: Sequence[str] | dict[str | int, Sequence[str]] = ..., keep_default_na: bool = ..., na_filter: bool = ..., verbose: bool = ..., parse_dates: bool | Sequence[int] | Sequence[Sequence[str] | Sequence[int]] | dict[str, Sequence[int] | list[str]] = ..., date_format: dict[Hashable, str] | str | None = ..., thousands: str | None = ..., decimal: str = ..., comment: str | None = ..., skipfooter: int = ..., storage_options: dict[str, Any] | None = ..., dtype_backend: Literal['pyarrow', 'numpy_nullable'] | Literal[_NoDefault.no_default] = ...) -> dict[int | str, DataFrame]
+ python/pyspark/pandas/namespace.py:1139: note: def read_excel(io: str | PathLike[str] | ReadBuffer[bytes] | ExcelFile | Any | Any | Any | Any, sheet_name: list[int | str], *, header: int | Sequence[int] | None = ..., names: MutableSequence[Any] | ndarray[tuple[Any, ...], dtype[Any]] | tuple[Any, ...] | range | None = ..., index_col: int | Sequence[int] | str | None = ..., usecols: str | SequenceNotStr[Hashable] | range | ExtensionArray | ndarray[Any, Any] | Index[Any] | Series[Any] | Callable[[Any], bool] | None = ..., dtype: str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object] | Mapping[str, str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object]] | None = ..., engine: Literal['xlrd', 'openpyxl', 'odf', 'pyxlsb', 'calamine'] | None = ..., converters: Mapping[int | str, Callable[[object], object]] | None = ..., true_values: Iterable[Hashable] | None = ..., false_values: Iterable[Hashable] | None = ..., skiprows: int | Sequence[int] | Callable[[object], bool] | None = ..., nrows: int | None = ..., na_values: Sequence[str] | dict[str | int, Sequence[str]] = ..., keep_default_na: bool = ..., na_filter: bool = ..., verbose: bool = ..., parse_dates: bool | Sequence[int] | Sequence[Sequence[str] | Sequence[int]] | dict[str, Sequence[int] | list[str]] = ..., date_format: dict[Hashable, str] | str | None = ..., thousands: str | None = ..., decimal: str = ..., comment: str | None = ..., skipfooter: int = ..., storage_options: dict[str, Any] | None = ..., dtype_backend: Literal['pyarrow', 'numpy_nullable'] | Literal[_NoDefault.no_default] = ...) -> dict[int | str, DataFrame]
- python/pyspark/pandas/namespace.py:1139: note: def read_excel(io: str | PathLike[str] | ReadBuffer[bytes] | ExcelFile | Any | Any | Any | Any, sheet_name: int | str = ..., *, header: int | Sequence[int] | None = ..., names: MutableSequence[Any] | ndarray[tuple[int, ...], dtype[Any]] | tuple[Any, ...] | range | None = ..., index_col: int | Sequence[int] | str | None = ..., usecols: str | SequenceNotStr[Hashable] | range | ExtensionArray | ndarray[Any, Any] | Index[Any] | Series[Any] | Callable[[Any], bool] | None = ..., dtype: str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object] | Mapping[str, str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object]] | None = ..., engine: Literal['xlrd', 'openpyxl', 'odf', 'pyxlsb', 'calamine'] | None = ..., converters: Mapping[int | str, Callable[[object], object]] | None = ..., true_values: Iterable[Hashable] | None = ..., false_values: Iterable[Hashable] | None = ..., skiprows: int | Sequence[int] | Callable[[object], bool] | None = ..., nrows: int | None = ..., na_values: Sequence[str] | dict[str | int, Sequence[str]] = ..., keep_default_na: bool = ..., na_filter: bool = ..., verbose: bool = ..., parse_dates: bool | Sequence[int] | Sequence[Sequence[str] | Sequence[int]] | dict[str, Sequence[int] | list[str]] = ..., date_format: dict[Hashable, str] | str | None = ..., thousands: str | None = ..., decimal: str = ..., comment: str | None = ..., skipfooter: int = ..., storage_options: dict[str, Any] | None = ..., dtype_backend: Literal['pyarrow', 'numpy_nullable'] | Literal[_NoDefault.no_default] = ...) -> DataFrame
+ python/pyspark/pandas/namespace.py:1139: note: def read_excel(io: str | PathLike[str] | ReadBuffer[bytes] | ExcelFile | Any | Any | Any | Any, sheet_name: int | str = ..., *, header: int | Sequence[int] | None = ..., names: MutableSequence[Any] | ndarray[tuple[Any, ...], dtype[Any]] | tuple[Any, ...] | range | None = ..., index_col: int | Sequence[int] | str | None = ..., usecols: str | SequenceNotStr[Hashable] | range | ExtensionArray | ndarray[Any, Any] | Index[Any] | Series[Any] | Callable[[Any], bool] | None = ..., dtype: str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object] | Mapping[str, str | ExtensionDtype | str | dtype[generic[Any]] | type[str] | type[complex] | type[bool] | type[object]] | None = ..., engine: Literal['xlrd', 'openpyxl', 'odf', 'pyxlsb', 'calamine'] | None = ..., converters: Mapping[int | str, Callable[[object], object]] | None = ..., true_values: Iterable[Hashable] | None = ..., false_values: Iterable[Hashable] | None = ..., skiprows: int | Sequence[int] | Callable[[object], bool] | None = ..., nrows: int | None = ..., na_values: Sequence[str] | dict[str | int, Sequence[str]] = ..., keep_default_na: bool = ..., na_filter: bool = ..., verbose: bool = ..., parse_dates: bool | Sequence[int] | Sequence[Sequence[str] | Sequence[int]] | dict[str, Sequence[int] | list[str]] = ..., date_format: dict[Hashable, str] | str | None = ..., thousands: str | None = ..., decimal: str = ..., comment: str | None = ..., skipfooter: int = ..., storage_options: dict[str, Any] | None = ..., dtype_backend: Literal['pyarrow', 'numpy_nullable'] | Literal[_NoDefault.no_default] = ...) -> DataFrame
- python/pyspark/ml/linalg/__init__.py:1145: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[Any]]") [assignment]
- python/pyspark/ml/linalg/__init__.py:1149: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[Any]]") [assignment]
- python/pyspark/ml/functions.py:244: note: def [_ScalarT: generic[Any]] vstack(tup: Sequence[_SupportsArray[dtype[_ScalarT]] | _NestedSequence[_SupportsArray[dtype[_ScalarT]]]], *, dtype: None = ..., casting: Literal['no', 'equiv', 'safe', 'same_kind', 'unsafe'] = ...) -> ndarray[tuple[int, ...], dtype[_ScalarT]]
+ python/pyspark/ml/functions.py:244: note: def [_ScalarT: generic[Any]] vstack(tup: Sequence[_SupportsArray[dtype[_ScalarT]] | _NestedSequence[_SupportsArray[dtype[_ScalarT]]]], *, dtype: None = ..., casting: Literal['no', 'equiv', 'safe', 'same_kind', 'unsafe'] = ...) -> ndarray[tuple[Any, ...], dtype[_ScalarT]]
- python/pyspark/ml/functions.py:244: note: def [_ScalarT: generic[Any]] vstack(tup: Sequence[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]], *, dtype: type[_ScalarT] | dtype[_ScalarT] | _SupportsDType[dtype[_ScalarT]], casting: Literal['no', 'equiv', 'safe', 'same_kind', 'unsafe'] = ...) -> ndarray[tuple[int, ...], dtype[_ScalarT]]
+ python/pyspark/ml/functions.py:244: note: def [_ScalarT: generic[Any]] vstack(tup: Sequence[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]], *, dtype: type[_ScalarT] | dtype[_ScalarT] | _SupportsDType[dtype[_ScalarT]], casting: Literal['no', 'equiv', 'safe', 'same_kind', 'unsafe'] = ...) -> ndarray[tuple[Any, ...], dtype[_ScalarT]]
... (truncated 4 lines) ...
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/util.py:1977: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/rank.py:79: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/rank.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/rank.py:96: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/loc_map.py:413: error: Incompatible types in assignment (expression has type "unsignedinteger[_64Bit]", variable has type "ndarray[tuple[Any, ...], dtype[unsignedinteger[_64Bit]]]") [assignment]
- static_frame/core/frame.py:7524: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[Any]]") [assignment]
scipy-stubs (https://github.com/scipy/scipy-stubs)
- tests/optimize/minimize.pyi:13: error: No overload variant of "minimize" matches argument types "Callable[[ndarray[tuple[int, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]], ndarray[tuple[int, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]], float64]", "int", "tuple[ndarray[tuple[int, ...], dtype[Any]]]", "str", "dict[str, float]" [call-overload]
+ tests/optimize/minimize.pyi:13: error: No overload variant of "minimize" matches argument types "Callable[[ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]], float64]", "int", "tuple[ndarray[tuple[Any, ...], dtype[Any]]]", "str", "dict[str, float]" [call-overload]
pandera (https://github.com/pandera-dev/pandera)
- pandera/engines/pandas_engine.py:1384: error: Invalid index type "Series[builtins.bool] | DataFrame" for "Series[Any]"; expected type "list[str] | Index[Any] | Series[Any] | slice[Any, Any, Any] | Series[builtins.bool] | ndarray[tuple[int, ...], dtype[numpy.bool[builtins.bool]]] | list[builtins.bool] | tuple[Hashable | slice[Any, Any, Any], ...]" [index]
+ pandera/engines/pandas_engine.py:1384: error: Invalid index type "Series[builtins.bool] | DataFrame" for "Series[Any]"; expected type "list[str] | Index[Any] | Series[Any] | slice[Any, Any, Any] | Series[builtins.bool] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | list[builtins.bool] | tuple[Hashable | slice[Any, Any, Any], ...]" [index]
- pandera/strategies/pandas_strategies.py:71: note: def mask(self, cond: Series[Any] | Series[bool] | ndarray[tuple[int, ...], dtype[Any]] | Callable[[Series[Any]], Series[bool]] | Callable[[Any], bool], other: str | bytes | date | datetime | timedelta | <12 more items> | None = ..., *, inplace: Literal[True], axis: Literal['index', 0] | None = ..., level: Hashable | int | None = ...) -> None
+ pandera/strategies/pandas_strategies.py:71: note: def mask(self, cond: Series[Any] | Series[bool] | ndarray[tuple[Any, ...], dtype[Any]] | Callable[[Series[Any]], Series[bool]] | Callable[[Any], bool], other: str | bytes | date | datetime | timedelta | <12 more items> | None = ..., *, inplace: Literal[True], axis: Literal['index', 0] | None = ..., level: Hashable | int | None = ...) -> None
... (truncated 16 lines) ...``` |
Member
Author
|
@mroeschke here's another one that's causing some new mypy errors in pandas. Are you seeing anything you don't like? |
Contributor
|
Looks OK to me |
Member
Author
|
@MarcoGorelli this also touches a bit of |
MarcoGorelli
left a comment
Member
There was a problem hiding this comment.
nice, thanks for the ping
Member
|
Let's give it a shot. Thanks Joren. |
This was referenced May 19, 2025
This was referenced Jun 4, 2025
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.
From the typing spec:
So by using
tuple[Any, ...]instead oftuple[int, ...]as shape-type default, we prevent situations where users are not allowed to assign an array with unknown shape-type to an array-type with a known shape type.The downside is that there are certain situations where (mostly) mypy will over-eagerly pick the first overload, where it would previously pick a different one. But I only saw this happen once in the tests, and managed to work around it.
Let's see what mypy_primer has to say about this.