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

Commit3231e03

Browse files
Backport PR#3310: obstore delete_dir (#3437)
Co-authored-by: Kenneth Li <kli@sescollc.com>
1 parent8b00b94 commit3231e03

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:
@@ -196,6 +197,18 @@ async def delete(self, key: str) -> None:
196197
withcontextlib.suppress(FileNotFoundError):
197198
awaitobs.delete_async(self.store,key)
198199

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp