You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ZipStore.list() fails if store not opened + lack of high-level listing API #3846
mamba, bug confirmed in latest Git of the project 19a383f
Description
ZipStore.list() uses _lock and _zf
but does not ensure the store is opened
leads to:
AttributeError: 'ZipStore' object has no attribute '_lock' when underlying store is not opened
I do not know if the behavior affects other types of stores.
Expected behavior
list() should ensure the store is opened (similar to _get()), e.g. by calling _sync_open() if needed.
Question
I’m not sure if this affects other store implementations as well, or only ZipStore.
Enhancement / API suggestion
Currently list() exposes raw storage keys (chunks, metadata), which is often not very useful at user level.
It would be helpful to have a higher-level API that lists logical Zarr objects (groups/arrays), for example:
zarr.list_nodes(store)
Steps to reproduce
import zarr
import zarr, asyncio
store = zarr.storage.ZipStore("data.zip", mode="r")
async def main():
return [k async for k in store.list()]
Activity
fix: auto-open ZipStore in list(), list_dir() and exists()
fix: auto-open ZipStore in list(), list_dir() and exists() (#3855)