|
27 | 27 | from ..core import Entity, ExecutableTuple |
28 | 28 | from ..lib.mmh3 import hash as mmh_hash |
29 | 29 | from ..tensor.utils import dictify_chunk_size, normalize_chunk_sizes |
30 | | -from ..utils import tokenize, sbytes, lazy_import, ModulePlaceholder |
| 30 | +from ..utils import tokenize, sbytes, lazy_import, ModulePlaceholder, is_full_slice |
31 | 31 |
|
32 | 32 | try: |
33 | 33 | import pyarrow as pa |
@@ -804,9 +804,13 @@ def filter_index_value(index_value, min_max, store_data=False): |
804 | 804 | return parse_index(pd_index[f], store_data=store_data) |
805 | 805 |
|
806 | 806 |
|
807 | | -def indexing_index_value(index_value, indexes, store_data=False): |
| 807 | +def indexing_index_value(index_value, indexes, store_data=False, rechunk=False): |
808 | 808 | pd_index = index_value.to_pandas() |
809 | | - if not index_value.has_value(): |
| 809 | + # when rechunk is True, the output index shall be treated |
| 810 | + # different from the input one |
| 811 | + if not rechunk and isinstance(indexes, slice) and is_full_slice(indexes): |
| 812 | + return index_value |
| 813 | + elif not index_value.has_value(): |
810 | 814 | new_index_value = parse_index(pd_index, indexes, store_data=store_data) |
811 | 815 | new_index_value._index_value._min_val = index_value.min_val |
812 | 816 | new_index_value._index_value._min_val_close = index_value.min_val_close |
|
0 commit comments