We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0c56fb commit 8017d6bCopy full SHA for 8017d6b
1 file changed
src/zarr/storage/_obstore.py
@@ -13,6 +13,7 @@
13
Store,
14
SuffixByteRequest,
15
)
16
+from zarr.core.common import concurrent_map
17
from zarr.core.config import config
18
19
if TYPE_CHECKING:
@@ -196,6 +197,15 @@ async def delete(self, key: str) -> None:
196
197
with contextlib.suppress(FileNotFoundError):
198
await obs.delete_async(self.store, key)
199
200
+ async def delete_dir(self, prefix: str) -> None:
201
+ # docstring inherited
202
+ self._check_writable()
203
+ if prefix != "" and not prefix.endswith("/"):
204
+ prefix += "/"
205
+
206
+ keys = [(k,) async for k in self.list_prefix(prefix)]
207
+ await concurrent_map(keys, self.delete, limit=config.get("async.concurrency"))
208
209
@property
210
def supports_partial_writes(self) -> bool:
211
# docstring inherited
0 commit comments