Skip to content

Commit bd912ef

Browse files
committed
memory store clear is scoped to the path
1 parent 84c545f commit bd912ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/zarr/storage/memory.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ async def empty(self) -> bool:
6161

6262
async def clear(self) -> None:
6363
# docstring inherited
64-
self._store_dict.clear()
64+
for k in tuple(self._store_dict.keys()):
65+
if k.startswith(self.path):
66+
del self._store_dict[k]
6567

6668
def with_mode(self, mode: AccessModeLiteral) -> Self:
6769
# docstring inherited

0 commit comments

Comments
 (0)