|
4 | 4 | import functools |
5 | 5 | import operator |
6 | 6 | from collections import Counter, defaultdict |
7 | | -from collections.abc import Hashable, Iterable, Mapping |
| 7 | +from collections.abc import Hashable, Mapping |
8 | 8 | from contextlib import suppress |
9 | 9 | from dataclasses import dataclass, field |
10 | 10 | from datetime import timedelta |
@@ -1418,23 +1418,6 @@ def __init__(self, array): |
1418 | 1418 | self.array = array |
1419 | 1419 |
|
1420 | 1420 | def __getitem__(self, key): |
1421 | | - if not isinstance(key, VectorizedIndexer): |
1422 | | - # if possible, short-circuit when keys are effectively slice(None) |
1423 | | - # This preserves dask name and passes lazy array equivalence checks |
1424 | | - # (see duck_array_ops.lazy_array_equiv) |
1425 | | - rewritten_indexer = False |
1426 | | - new_indexer = [] |
1427 | | - for idim, k in enumerate(key.tuple): |
1428 | | - if isinstance(k, Iterable) and ( |
1429 | | - not is_duck_dask_array(k) |
1430 | | - and duck_array_ops.array_equiv(k, np.arange(self.array.shape[idim])) |
1431 | | - ): |
1432 | | - new_indexer.append(slice(None)) |
1433 | | - rewritten_indexer = True |
1434 | | - else: |
1435 | | - new_indexer.append(k) |
1436 | | - if rewritten_indexer: |
1437 | | - key = type(key)(tuple(new_indexer)) |
1438 | 1421 |
|
1439 | 1422 | if isinstance(key, BasicIndexer): |
1440 | 1423 | return self.array[key.tuple] |
|
0 commit comments