@@ -772,7 +772,8 @@ def fillna(
772
772
elif method is not None :
773
773
msg = "fillna with 'method' requires high memory usage."
774
774
warnings .warn (msg , PerformanceWarning )
775
- new_values = np .asarray (self )
775
+ # Need type annotation for "new_values" [var-annotated]
776
+ new_values = np .asarray (self ) # type: ignore[var-annotated]
776
777
# interpolate_2d modifies new_values inplace
777
778
interpolate_2d (new_values , method = method , limit = limit )
778
779
return type (self )(new_values , fill_value = self .fill_value )
@@ -924,7 +925,15 @@ def __getitem__(
924
925
if is_integer (key ):
925
926
return self ._get_val_at (key )
926
927
elif isinstance (key , tuple ):
927
- data_slice = self .to_dense ()[key ]
928
+ # Invalid index type "Tuple[Union[int, ellipsis], ...]" for
929
+ # "ndarray[Any, Any]"; expected type "Union[SupportsIndex,
930
+ # _SupportsArray[dtype[Union[bool_, integer[Any]]]], _NestedSequence[_Su
931
+ # pportsArray[dtype[Union[bool_, integer[Any]]]]],
932
+ # _NestedSequence[Union[bool, int]], Tuple[Union[SupportsIndex,
933
+ # _SupportsArray[dtype[Union[bool_, integer[Any]]]],
934
+ # _NestedSequence[_SupportsArray[dtype[Union[bool_, integer[Any]]]]], _N
935
+ # estedSequence[Union[bool, int]]], ...]]" [index]
936
+ data_slice = self .to_dense ()[key ] # type: ignore[index]
928
937
elif isinstance (key , slice ):
929
938
930
939
# Avoid densifying when handling contiguous slices
@@ -1164,7 +1173,9 @@ def _concat_same_type(
1164
1173
1165
1174
data = np .concatenate (values )
1166
1175
indices_arr = np .concatenate (indices )
1167
- sp_index = IntIndex (length , indices_arr )
1176
+ # Argument 2 to "IntIndex" has incompatible type "ndarray[Any,
1177
+ # dtype[signedinteger[_32Bit]]]"; expected "Sequence[int]"
1178
+ sp_index = IntIndex (length , indices_arr ) # type: ignore[arg-type]
1168
1179
1169
1180
else :
1170
1181
# when concatenating block indices, we don't claim that you'll
@@ -1342,7 +1353,8 @@ def __setstate__(self, state):
1342
1353
if isinstance (state , tuple ):
1343
1354
# Compat for pandas < 0.24.0
1344
1355
nd_state , (fill_value , sp_index ) = state
1345
- sparse_values = np .array ([])
1356
+ # Need type annotation for "sparse_values" [var-annotated]
1357
+ sparse_values = np .array ([]) # type: ignore[var-annotated]
1346
1358
sparse_values .__setstate__ (nd_state )
1347
1359
1348
1360
self ._sparse_values = sparse_values
0 commit comments