File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,15 @@ async def list(self) -> AsyncIterator[str]:
193193
194194 async def list_prefix (self , prefix : str ) -> AsyncIterator [str ]:
195195 # docstring inherited
196- # note: we materialize all dict keys into a list here so we can mutate the dict in-place (e.g. in delete_prefix)
196+ # Normalise prefix to use directory-boundary semantics consistent with LocalStore:
197+ # list_prefix("0") must match "0/zarr.json" but NOT "0_c/zarr.json".
198+ # We strip any trailing "/" then re-add it so the startswith check only
199+ # matches at a path separator, not mid-name.
200+ # note: we materialise all dict keys into a list here so we can mutate
201+ # the dict in-place (e.g. in delete_prefix)
202+ prefix = prefix .rstrip ("/" )
203+ if prefix :
204+ prefix = prefix + "/"
197205 for key in list (self ._store_dict ):
198206 if key .startswith (prefix ):
199207 yield key
You can’t perform that action at this time.
0 commit comments