-
-
Notifications
You must be signed in to change notification settings - Fork 329
Improve error handling in zarr.open_group
#2821
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
Comments
thanks for the report, we should definitely fix this! |
What should the error be here? |
At this level of the API something |
IIRC, 2.18 raises a |
Turns out you can reproduce a similar problem with a much simpler example: store = MemoryStore
root = zarr.open(store=store, mode='w')
root.create_group('foo')
# open non-existent group
zarr.open_group(
store=store,
path='/bar',
mode='r',
)
Presumably this should also raise a |
I think we should consider this carefully, in part because if any of these exceptions can bubble up the user then they are effectively public API. If we ignore off-target effects of this change, I don't see what |
I think there's two separate issues. One is that the code can get into an inconsistent state, which is caught by this assert: zarr-python/src/zarr/core/group.py Line 397 in ee60792
The second is that the code raises zarr-python/src/zarr/api/asynchronous.py Line 827 in ee60792
zarr-python/src/zarr/core/array.py Line 171 in ee60792
This should either be replaced with I think both should be fixed, but I might see if I can fix the former separately from fixing the latter, as I can see that changing the latter might require some discussion. |
Zarr version
v3.0.1
Numcodecs version
v0.15.0
Python Version
3.12
Operating System
Linux
Installation
conda
Description
Based on this comment the error message should be improved when attempting to open a Zarr group.
Steps to reproduce
when reading a subgroup that doesn't exist,
Additional output
No response
The text was updated successfully, but these errors were encountered: