zarr-python icon indicating copy to clipboard operation
zarr-python copied to clipboard

[v3] deleting a group does not delete subgroups

Open dcherian opened this issue 1 year ago • 2 comments

Zarr version

3

Numcodecs version

?

Python Version

?

Operating System

?

Installation

?

Description

deleting a group does not delete subgroups.

Discovered in #2189

Steps to reproduce

import zarr
from zarr.store import MemoryStore

store = MemoryStore(mode="w")
g1 = zarr.group(store=store)
g1.create_group("0")
g1.create_group("0/0")
del g1["0"]
g1["0/0"] # succeeds

Additional output

No response

dcherian avatar Sep 17 '24 02:09 dcherian

Looks like the MemoryStore implementation is missing a erase_prefix function to allow proper deletion of a group and its children.

zoj613 avatar Sep 17 '24 03:09 zoj613

I have a fix for this in the works.

jhamman avatar Oct 22 '24 00:10 jhamman