Skip to content

Commit a998da8

Browse files
committed
WIP: mypy support 1.17.1
1 parent 3940df8 commit a998da8

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

pandas/core/_numba/executor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ def column_looper(
8787
else:
8888

8989
@numba.jit(nopython=nopython, nogil=nogil, parallel=parallel)
90-
def column_looper(
90+
# error: Incompatible redefinition (redefinition with type
91+
# "Callable[[ndarray[Any, Any], ndarray[Any, Any], ndarray[Any, Any],
92+
# int, VarArg(Any)], Any]", original type "Callable[[ndarray[Any, Any],
93+
# ndarray[Any, Any], int, int, VarArg(Any)], Any]")
94+
def column_looper( # type: ignore[misc]
9195
values: np.ndarray,
9296
start: np.ndarray,
9397
end: np.ndarray,

pandas/core/util/hashing.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,7 @@ def _hash_ndarray(
344344
vals ^= vals >> 27
345345
vals *= np.uint64(0x94D049BB133111EB)
346346
vals ^= vals >> 31
347-
return vals
347+
# error: Incompatible return value type (got "Any | ndarray[tuple[int, ...],
348+
# dtype[signedinteger[Any]]]", expected "ndarray[tuple[int, ...],
349+
# dtype[unsignedinteger[_64Bit]]]")
350+
return vals # type: ignore[return-value]

pandas/io/common.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,7 @@ def get_handle(
951951
)
952952

953953

954-
# error: Definition of "__enter__" in base class "IOBase" is incompatible
955-
# with definition in base class "BinaryIO"
956-
class _BufferedWriter(BytesIO, ABC): # type: ignore[misc]
954+
class _BufferedWriter(BytesIO, ABC):
957955
"""
958956
Some objects do not support multiple .write() calls (TarFile and ZipFile).
959957
This wrapper writes to the underlying buffer on close.
@@ -990,9 +988,10 @@ def __init__(
990988
super().__init__()
991989
self.archive_name = archive_name
992990
self.name = name
993-
# error: Incompatible types in assignment (expression has type "TarFile",
994-
# base class "_BufferedWriter" defined the type as "BytesIO")
995-
self.buffer: tarfile.TarFile = tarfile.TarFile.open( # type: ignore[assignment]
991+
# error: No overload variant of "open" of "TarFile" matches argument
992+
# types "str | None", "str", "ReadBuffer[bytes] | WriteBuffer[bytes] | None",
993+
# "dict[str, Any]"
994+
self.buffer: tarfile.TarFile = tarfile.TarFile.open( # type: ignore[call-overload]
996995
name=name,
997996
mode=self.extend_mode(mode),
998997
fileobj=fileobj,
@@ -1045,9 +1044,10 @@ def __init__(
10451044
self.archive_name = archive_name
10461045

10471046
kwargs.setdefault("compression", zipfile.ZIP_DEFLATED)
1048-
# error: Incompatible types in assignment (expression has type "ZipFile",
1049-
# base class "_BufferedWriter" defined the type as "BytesIO")
1050-
self.buffer: zipfile.ZipFile = zipfile.ZipFile( # type: ignore[assignment]
1047+
# error: No overload variant of "ZipFile" matches argument types
1048+
# "str | PathLike[str] | ReadBuffer[bytes] | WriteBuffer[bytes]",
1049+
# "str", "dict[str, Any]"
1050+
self.buffer: zipfile.ZipFile = zipfile.ZipFile( # type: ignore[call-overload]
10511051
file, mode, **kwargs
10521052
)
10531053

0 commit comments

Comments
 (0)