@@ -260,6 +260,7 @@ class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin):
260
260
_pandas_ftype = "sparse"
261
261
_subtyp = "sparse_array" # register ABCSparseArray
262
262
_deprecations = PandasObject ._deprecations | frozenset (["get_values" ])
263
+ _sparse_index : SparseIndex
263
264
264
265
def __init__ (
265
266
self ,
@@ -372,8 +373,8 @@ def __init__(
372
373
373
374
@classmethod
374
375
def _simple_new (
375
- cls , sparse_array : np .ndarray , sparse_index : SparseIndex , dtype : SparseDtype
376
- ) -> ABCSparseArray :
376
+ cls , sparse_array : np .ndarray , sparse_index : SparseIndex , dtype : SparseDtype ,
377
+ ) -> "SparseArray" :
377
378
new = cls ([])
378
379
new ._sparse_index = sparse_index
379
380
new ._sparse_values = sparse_array
@@ -1392,8 +1393,8 @@ def __abs__(self):
1392
1393
# ------------------------------------------------------------------------
1393
1394
1394
1395
@classmethod
1395
- def _create_unary_method (cls , op ):
1396
- def sparse_unary_method (self ):
1396
+ def _create_unary_method (cls , op ) -> Callable [[ "SparseArray" ], "SparseArray" ] :
1397
+ def sparse_unary_method (self ) -> "SparseArray" :
1397
1398
fill_value = op (np .array (self .fill_value )).item ()
1398
1399
values = op (self .sp_values )
1399
1400
dtype = SparseDtype (values .dtype , fill_value )
0 commit comments