@@ -455,8 +455,9 @@ async def _decode_single(
455455 chunk_spec ,
456456 chunk_selection ,
457457 out_selection ,
458+ is_complete_shard ,
458459 )
459- for chunk_coords , chunk_selection , out_selection in indexer
460+ for chunk_coords , chunk_selection , out_selection , is_complete_shard in indexer
460461 ],
461462 out ,
462463 )
@@ -486,7 +487,7 @@ async def _decode_partial_single(
486487 )
487488
488489 indexed_chunks = list (indexer )
489- all_chunk_coords = {chunk_coords for chunk_coords , _ , _ in indexed_chunks }
490+ all_chunk_coords = {chunk_coords for chunk_coords , * _ in indexed_chunks }
490491
491492 # reading bytes of all requested chunks
492493 shard_dict : ShardMapping = {}
@@ -524,12 +525,17 @@ async def _decode_partial_single(
524525 chunk_spec ,
525526 chunk_selection ,
526527 out_selection ,
528+ is_complete_shard ,
527529 )
528- for chunk_coords , chunk_selection , out_selection in indexer
530+ for chunk_coords , chunk_selection , out_selection , is_complete_shard in indexer
529531 ],
530532 out ,
531533 )
532- return out
534+
535+ if hasattr (indexer , "sel_shape" ):
536+ return out .reshape (indexer .sel_shape )
537+ else :
538+ return out
533539
534540 async def _encode_single (
535541 self ,
@@ -558,8 +564,9 @@ async def _encode_single(
558564 chunk_spec ,
559565 chunk_selection ,
560566 out_selection ,
567+ is_complete_shard ,
561568 )
562- for chunk_coords , chunk_selection , out_selection in indexer
569+ for chunk_coords , chunk_selection , out_selection , is_complete_shard in indexer
563570 ],
564571 shard_array ,
565572 )
@@ -601,8 +608,9 @@ async def _encode_partial_single(
601608 chunk_spec ,
602609 chunk_selection ,
603610 out_selection ,
611+ is_complete_shard ,
604612 )
605- for chunk_coords , chunk_selection , out_selection in indexer
613+ for chunk_coords , chunk_selection , out_selection , is_complete_shard in indexer
606614 ],
607615 shard_array ,
608616 )
0 commit comments