Skip to content

Commit 13bf29c

Browse files
simonjayhawkinsNico Cernek
authored and
Nico Cernek
committed
TYPING: errors reported by mypy 0.730 (pandas-dev#28910)
1 parent c9158a7 commit 13bf29c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/compat/pickle_compat.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ def load_reduce(self):
6868

6969
class _LoadSparseSeries:
7070
# To load a SparseSeries as a Series[Sparse]
71-
def __new__(cls) -> "Series":
71+
72+
# https://github.com/python/mypy/issues/1020
73+
# error: Incompatible return type for "__new__" (returns "Series", but must return
74+
# a subtype of "_LoadSparseSeries")
75+
def __new__(cls) -> "Series": # type: ignore
7276
from pandas import Series
7377

7478
warnings.warn(
@@ -82,7 +86,11 @@ def __new__(cls) -> "Series":
8286

8387
class _LoadSparseFrame:
8488
# To load a SparseDataFrame as a DataFrame[Sparse]
85-
def __new__(cls) -> "DataFrame":
89+
90+
# https://github.com/python/mypy/issues/1020
91+
# error: Incompatible return type for "__new__" (returns "DataFrame", but must
92+
# return a subtype of "_LoadSparseFrame")
93+
def __new__(cls) -> "DataFrame": # type: ignore
8694
from pandas import DataFrame
8795

8896
warnings.warn(

0 commit comments

Comments
 (0)