-
-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keys
/items
yields two diferent results between v2 and v3
#2757
Comments
can you list the contents of the zip store, as zarr sees it? there's an async method on the |
[item async for item in store.list_prefix("")] ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[16], line 1
----> 1 [item async for item in store.list_prefix("")]
File ~/Projects/Theis/zarr-python/src/zarr/storage/_zip.py:256, in ZipStore.list_prefix(self, prefix)
254 async def list_prefix(self, prefix: str) -> AsyncIterator[str]:
255 # docstring inherited
--> 256 async for key in self.list():
257 if key.startswith(prefix):
258 yield key
File ~/Projects/Theis/zarr-python/src/zarr/storage/_zip.py:250, in ZipStore.list(self)
248 async def list(self) -> AsyncIterator[str]:
249 # docstring inherited
--> 250 with self._lock:
251 for key in self._zf.namelist():
252 yield key
AttributeError: 'ZipStore' object has no attribute '_lock' This is from an |
zipstore is a little special, you might need to invoke a special method to completely create one (yes, this is cursed) |
Just from
|
so the stuff coming out of zarr-python/src/zarr/core/group.py Line 2809 in 0c154c3
that's where the to-be-recursed function lists the keys it can see at a given level of the hierarchy. this method, and the line I linked, are both async generators, which are kind of annoying to invoke in non-async code. you will need another helper function ( e.g., to replicate that |
@d-v-b For me, this old zip store is producing "groups" as keys from That being said, there is a check for this in the |
Zarr version
0c154c3
Numcodecs version
0.15.0
Python Version
3.12
Operating System
Mac ARM
Installation
uv
Description
I have an admittedly old zarr zip store where the
keys
from one of the subgroups appears to be yielding itself in zarr v3 (erroneously as it errors out on access) but correctly in zarr v2. I can't reproduce this just by creating groups in v3 or v2, with either the current main branch or the final v2 commit.It's possible the file is corrupted or something, tough to say since it is a zip store. The same problem does not happen when I unzip the store and either visually examine its contents or when I actually open the store using
zarr.open
and then run.keys()
Steps to reproduce
adata.zarr.zip
For the above file one should run in v2:
and then
Additional output
No response
The text was updated successfully, but these errors were encountered: