@@ -68,7 +68,11 @@ def load_reduce(self):
68
68
69
69
class _LoadSparseSeries :
70
70
# 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
72
76
from pandas import Series
73
77
74
78
warnings .warn (
@@ -82,7 +86,11 @@ def __new__(cls) -> "Series":
82
86
83
87
class _LoadSparseFrame :
84
88
# 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
86
94
from pandas import DataFrame
87
95
88
96
warnings .warn (
@@ -191,10 +199,10 @@ def __new__(cls) -> "DataFrame":
191
199
192
200
193
201
# our Unpickler sub-class to override methods and some dispatcher
194
- # functions for compat
195
-
202
+ # functions for compat and uses a non-public class of the pickle module.
196
203
197
- class Unpickler (pkl ._Unpickler ):
204
+ # error: Name 'pkl._Unpickler' is not defined
205
+ class Unpickler (pkl ._Unpickler ): # type: ignore
198
206
def find_class (self , module , name ):
199
207
# override superclass
200
208
key = (module , name )
0 commit comments