Skip to content

Commit 9210483

Browse files
committed
raise on bad usage
1 parent d04d008 commit 9210483

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

zarr/storage.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,17 @@ def listdir(self, path: str = "") -> List[str]:
132132
return _listdir_from_keys(self, path)
133133

134134
def rename(self, src_path: str, dst_path: str) -> None:
135+
if not self.is_erasable():
136+
raise NotImplementedError(
137+
f'{type(self)} is not erasable, cannot call "rmdir"'
138+
)
135139
_rename_from_keys(self, src_path, dst_path)
136140

137141
def rmdir(self, path: str = "") -> None:
142+
if not self.is_erasable():
143+
raise NotImplementedError(
144+
f'{type(self)} is not erasable, cannot call "rmdir"'
145+
)
138146
path = normalize_storage_path(path)
139147
_rmdir_from_keys(self, path)
140148

0 commit comments

Comments
 (0)