Skip to content

Commit 2e99a4d

Browse files
committed
use obstore list and collect_async
1 parent 2450594 commit 2e99a4d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/zarr/storage/_obstore.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,14 @@ async def delete(self, key: str) -> None:
199199

200200
async def delete_dir(self, prefix: str) -> None:
201201
# docstring inherited
202+
import obstore as obs
203+
202204
self._check_writable()
203205
if prefix != "" and not prefix.endswith("/"):
204206
prefix += "/"
205207

206-
keys = [(k,) async for k in self.list_prefix(prefix)]
208+
metas = await obs.list(self.store, prefix).collect_async()
209+
keys = [(m["path"],) for m in metas]
207210
await concurrent_map(keys, self.delete, limit=config.get("async.concurrency"))
208211

209212
@property

0 commit comments

Comments
 (0)