File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -555,19 +555,19 @@ async def array(
555555
556556 new_array = await create (data .shape , ** kwargs )
557557
558- async def _copy_chunk (chunk_coords : ChunkCoords | slice ) -> None :
559- arr = await data ._async_array .getitem (chunk_coords )
558+ async def _copy_chunk (chunk_coords : ChunkCoords | slice , _data : Array ) -> None :
559+ arr = await _data ._async_array .getitem (chunk_coords )
560560 await new_array .setitem (chunk_coords , arr )
561561
562562 if new_array .chunks == data .chunks :
563563 # Stream data from the source array to the new array
564564 await concurrent_map (
565- [(region ,) for region in data ._iter_chunk_regions ()],
565+ [(region ,data ) for region in data ._iter_chunk_regions ()],
566566 _copy_chunk ,
567567 config .get ("async.concurrency" ),
568568 )
569569 else :
570- await _copy_chunk (slice (None ))
570+ await _copy_chunk (slice (None ), data )
571571 return new_array
572572
573573 # ensure data is array-like
You can’t perform that action at this time.
0 commit comments