@@ -772,7 +772,8 @@ def fillna(
772772 elif method is not None :
773773 msg = "fillna with 'method' requires high memory usage."
774774 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]
776777 # interpolate_2d modifies new_values inplace
777778 interpolate_2d (new_values , method = method , limit = limit )
778779 return type (self )(new_values , fill_value = self .fill_value )
@@ -924,7 +925,15 @@ def __getitem__(
924925 if is_integer (key ):
925926 return self ._get_val_at (key )
926927 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]
928937 elif isinstance (key , slice ):
929938
930939 # Avoid densifying when handling contiguous slices
@@ -1164,7 +1173,9 @@ def _concat_same_type(
11641173
11651174 data = np .concatenate (values )
11661175 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]
11681179
11691180 else :
11701181 # when concatenating block indices, we don't claim that you'll
@@ -1342,7 +1353,8 @@ def __setstate__(self, state):
13421353 if isinstance (state , tuple ):
13431354 # Compat for pandas < 0.24.0
13441355 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]
13461358 sparse_values .__setstate__ (nd_state )
13471359
13481360 self ._sparse_values = sparse_values
0 commit comments