Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita8da920

Browse files
slowjazzd-v-b
andauthored
obstore delete_dir (#3310)
* obstore delete_dir* add cl* add a delete test* use obstore list and collect_async* delete test---------Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
1 parent3d0e40e commita8da920

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎changes/3310.feature.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add obstore implementation of delete_dir.

‎src/zarr/storage/_obstore.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Store,
1414
SuffixByteRequest,
1515
)
16+
fromzarr.core.commonimportconcurrent_map
1617
fromzarr.core.configimportconfig
1718

1819
ifTYPE_CHECKING:
@@ -195,6 +196,18 @@ async def delete(self, key: str) -> None:
195196
withcontextlib.suppress(FileNotFoundError):
196197
awaitobs.delete_async(self.store,key)
197198

199+
asyncdefdelete_dir(self,prefix:str)->None:
200+
# docstring inherited
201+
importobstoreasobs
202+
203+
self._check_writable()
204+
ifprefix!=""andnotprefix.endswith("/"):
205+
prefix+="/"
206+
207+
metas=awaitobs.list(self.store,prefix).collect_async()
208+
keys= [(m["path"],)forminmetas]
209+
awaitconcurrent_map(keys,self.delete,limit=config.get("async.concurrency"))
210+
198211
@property
199212
defsupports_listing(self)->bool:
200213
# docstring inherited

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp