Skip to content

Commit f65a6e8

Browse files
committed
fix zip list_prefix
1 parent 43743e1 commit f65a6e8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/zarr/store/zip.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,21 @@ async def list(self) -> AsyncGenerator[str, None]:
209209
yield key
210210

211211
async def list_prefix(self, prefix: str) -> AsyncGenerator[str, None]:
212+
"""
213+
Retrieve all keys in the store that begin with a given prefix. Keys are returned with the
214+
common leading prefix removed.
215+
216+
Parameters
217+
----------
218+
prefix : str
219+
220+
Returns
221+
-------
222+
AsyncGenerator[str, None]
223+
"""
212224
async for key in self.list():
213225
if key.startswith(prefix):
214-
yield key
226+
yield key.removeprefix(prefix)
215227

216228
async def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
217229
if prefix.endswith("/"):

0 commit comments

Comments
 (0)