@@ -658,17 +658,11 @@ def shape(self) -> _Shape:
658
658
def get_duck_array (self ):
659
659
if isinstance (self .array , ExplicitlyIndexedNDArrayMixin ):
660
660
array = apply_indexer (self .array , self .key )
661
+ array = array .get_duck_array ()
661
662
else :
662
663
# If the array is not an ExplicitlyIndexedNDArrayMixin,
663
- # it may wrap a BackendArray so use its __getitem__
664
+ # it is a BackendArray so use its __getitem__
664
665
array = self .array [self .key ]
665
-
666
- # self.array[self.key] is now a numpy array when
667
- # self.array is a BackendArray subclass
668
- # and self.key is BasicIndexer((slice(None, None, None),))
669
- # so we need the explicit check for ExplicitlyIndexed
670
- if isinstance (array , ExplicitlyIndexed ):
671
- array = array .get_duck_array ()
672
666
return _wrap_numpy_scalars (array )
673
667
674
668
def transpose (self , order ):
@@ -734,16 +728,11 @@ def shape(self) -> _Shape:
734
728
def get_duck_array (self ):
735
729
if isinstance (self .array , ExplicitlyIndexedNDArrayMixin ):
736
730
array = apply_indexer (self .array , self .key )
731
+ array = array .get_duck_array ()
737
732
else :
738
733
# If the array is not an ExplicitlyIndexedNDArrayMixin,
739
- # it may wrap a BackendArray so use its __getitem__
734
+ # it is a BackendArray so use its __getitem__
740
735
array = self .array [self .key ]
741
- # self.array[self.key] is now a numpy array when
742
- # self.array is a BackendArray subclass
743
- # and self.key is BasicIndexer((slice(None, None, None),))
744
- # so we need the explicit check for ExplicitlyIndexed
745
- if isinstance (array , ExplicitlyIndexed ):
746
- array = array .get_duck_array ()
747
736
return _wrap_numpy_scalars (array )
748
737
749
738
def _updated_key (self , new_key : ExplicitIndexer ):
0 commit comments