@@ -472,7 +472,6 @@ def subset_dataset_to_block(
472
472
dim : _get_chunk_slicer (dim , chunk_index , input_chunk_bounds )
473
473
for dim in variable .dims
474
474
}
475
- subset = variable .isel (subsetter )
476
475
if set (variable .dims ) < chunk_dims_set :
477
476
# We are including a dimension coordinate,
478
477
# minimize duplication by not copying it in the graph for every chunk.
@@ -486,6 +485,7 @@ def subset_dataset_to_block(
486
485
f"{ name } -{ gname } -{ dask .base .tokenize (subsetter )} " ,
487
486
) + this_var_chunk_tuple
488
487
if chunk_variable_task not in graph :
488
+ subset = variable .isel (subsetter )
489
489
graph [chunk_variable_task ] = (
490
490
tuple ,
491
491
[subset .dims , subset ._data , subset .attrs ],
@@ -522,7 +522,9 @@ def subset_dataset_to_block(
522
522
expected ["data_vars" ] = set (template .data_vars .keys ()) # type: ignore[assignment]
523
523
expected ["coords" ] = set (template .coords .keys ()) # type: ignore[assignment]
524
524
expected ["indexes" ] = {
525
- dim : coordinates .xindexes [dim ][_get_chunk_slicer (dim , chunk_index , output_chunk_bounds )]
525
+ dim : coordinates .xindexes [dim ][
526
+ _get_chunk_slicer (dim , chunk_index , output_chunk_bounds )
527
+ ]
526
528
for dim in coordinates .xindexes
527
529
}
528
530
0 commit comments