Skip to content

Commit c750c10

Browse files
committed
using cast
1 parent 7531572 commit c750c10

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pandas/core/indexing.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
TYPE_CHECKING,
66
Hashable,
77
Sequence,
8+
cast,
89
final,
910
)
1011
import warnings
@@ -940,9 +941,7 @@ def _getitem_lowerdim(self, tup: tuple):
940941
with suppress(IndexingError):
941942
# error "_LocationIndexer" has no attribute
942943
# "_handle_lowerdim_multi_index_axis0"
943-
return self._handle_lowerdim_multi_index_axis0( # type: ignore[attr-defined]
944-
tup
945-
)
944+
return cast(_LocIndexer, self)._handle_lowerdim_multi_index_axis0(tup)
946945

947946
tup = self._validate_key_length(tup)
948947

@@ -1000,7 +999,7 @@ def _getitem_nested_tuple(self, tup: tuple):
1000999
with suppress(IndexingError):
10011000
# error "_LocationIndexer" has no attribute
10021001
# "_handle_lowerdim_multi_index_axis0"
1003-
return self._handle_lowerdim_multi_index_axis0( # type: ignore[attr-defined]
1002+
return cast(_LocIndexer, self)._handle_lowerdim_multi_index_axis0(
10041003
tup
10051004
)
10061005
elif isinstance(self.obj, ABCSeries) and any(

0 commit comments

Comments
 (0)