Skip to content

Commit 8a1e9e9

Browse files
committed
use relative path provided by members iterator
1 parent 1abaab6 commit 8a1e9e9

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/zarr/core/group.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -744,19 +744,12 @@ async def copy_to(
744744
zarr_format=self.metadata.zarr_format,
745745
)
746746

747-
async for _, member in self.members(
747+
async for child_path, member in self.members(
748748
max_depth=None, use_consolidated_for_children=use_consolidated_for_children
749749
):
750-
child_path = member.store_path.path
751-
if new_group.store_path.path:
752-
full_child_path = f"{new_group.store_path.path}/{child_path}"
753-
else:
754-
full_child_path = child_path
755-
target_path = StorePath(store=new_group.store, path=full_child_path)
756-
757750
if isinstance(member, AsyncGroup):
758751
await self.from_store(
759-
store=target_path,
752+
store=new_group.store_path / child_path,
760753
zarr_format=self.metadata.zarr_format,
761754
overwrite=overwrite,
762755
attributes=member.metadata.attributes,

0 commit comments

Comments
 (0)