Skip to content
forked from pydata/xarray

Commit b19a24b

Browse files
committed
Revert "Handle Indexing Adapter classes explicitly."
This reverts commit 46d98ec.
1 parent 46d98ec commit b19a24b

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

xarray/core/indexing.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,7 @@ def shape(self) -> tuple[int, ...]:
528528
def get_duck_array(self):
529529
array = as_indexable(self.array)
530530
array = array[self.key]
531-
if not isinstance(self.array, IndexingAdapter):
532-
array = array.get_duck_array()
531+
array = array.get_duck_array()
533532
return array
534533

535534
def transpose(self, order):
@@ -1239,11 +1238,7 @@ def is_fancy_indexer(indexer: Any) -> bool:
12391238
return True
12401239

12411240

1242-
class IndexingAdapter:
1243-
pass
1244-
1245-
1246-
class NumpyIndexingAdapter(ExplicitlyIndexedNDArrayMixin, IndexingAdapter):
1241+
class NumpyIndexingAdapter(ExplicitlyIndexedNDArrayMixin):
12471242
"""Wrap a NumPy array to use explicit indexing."""
12481243

12491244
__slots__ = ("array",)
@@ -1309,7 +1304,7 @@ def __init__(self, array):
13091304
self.array = array
13101305

13111306

1312-
class ArrayApiIndexingAdapter(ExplicitlyIndexedNDArrayMixin, IndexingAdapter):
1307+
class ArrayApiIndexingAdapter(ExplicitlyIndexedNDArrayMixin):
13131308
"""Wrap an array API array to use explicit indexing."""
13141309

13151310
__slots__ = ("array",)
@@ -1352,7 +1347,7 @@ def transpose(self, order):
13521347
return xp.permute_dims(self.array, order)
13531348

13541349

1355-
class DaskIndexingAdapter(ExplicitlyIndexedNDArrayMixin, IndexingAdapter):
1350+
class DaskIndexingAdapter(ExplicitlyIndexedNDArrayMixin):
13561351
"""Wrap a dask array to support explicit indexing."""
13571352

13581353
__slots__ = ("array",)
@@ -1428,7 +1423,7 @@ def transpose(self, order):
14281423
return self.array.transpose(order)
14291424

14301425

1431-
class PandasIndexingAdapter(ExplicitlyIndexedNDArrayMixin, IndexingAdapter):
1426+
class PandasIndexingAdapter(ExplicitlyIndexedNDArrayMixin):
14321427
"""Wrap a pandas.Index to preserve dtypes and handle explicit indexing."""
14331428

14341429
__slots__ = ("array", "_dtype")

0 commit comments

Comments
 (0)