Skip to content

Commit 2fb9083

Browse files
committed
create root correctly
1 parent e38c1ca commit 2fb9083

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/zarr/core/group.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2967,12 +2967,15 @@ async def create_nodes(
29672967
create_tasks.extend(
29682968
_prepare_save_metadata(store_path.store, f"{store_path.path}/{key}", value)
29692969
)
2970-
2970+
if store_path.path == "":
2971+
root = "/"
2972+
else:
2973+
root = store_path.path
29712974
created_keys = []
29722975
async with ctx:
29732976
for coro in asyncio.as_completed(create_tasks):
29742977
created_key = await coro
2975-
relative_path = PurePosixPath(created_key).relative_to(store_path.path)
2978+
relative_path = PurePosixPath(created_key).relative_to(root)
29762979
created_keys.append(str(relative_path))
29772980
# convert /foo/bar/baz/.zattrs to bar/baz
29782981
node_name = str(relative_path.parent)

0 commit comments

Comments
 (0)