We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c597d4 commit 201eebaCopy full SHA for 201eeba
xarray/core/indexing.py
@@ -594,7 +594,13 @@ def shape(self) -> tuple[int, ...]:
594
return np.broadcast(*self.key.tuple).shape
595
596
def __array__(self, dtype=None):
597
- return np.asarray(self.array[self.key], dtype=None)
+ return np.asarray(self.get_duck_array(), dtype=dtype)
598
+
599
+ def get_duck_array(self):
600
+ array = self.array[self.key]
601
+ if isinstance(array, ExplicitlyIndexed):
602
+ array = array.get_duck_array()
603
+ return array
604
605
def _updated_key(self, new_key):
606
return _combine_indexers(self.key, self.shape, new_key)
0 commit comments