-
-
Notifications
You must be signed in to change notification settings - Fork 354
Added ArrayNotFoundError #3367
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
base: main
Are you sure you want to change the base?
Added ArrayNotFoundError #3367
Conversation
thank you, this looks good. we should make sure we cover all the places in the codebase where we try to read an array. maybe it's just the 1 place you found, but we should double-check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two inline comments. In addition, did you thoroughly check that there's only a single place where an ArrayNotFoundError
should be raised?
@@ -161,7 +166,7 @@ async def test_open_array(memory_store: MemoryStore, zarr_format: ZarrFormat) -> | |||
assert z.read_only | |||
|
|||
# path not found | |||
with pytest.raises(FileNotFoundError): | |||
with pytest.raises(ArrayNotFoundError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently failing the tests, because it actually raises a GroupNotFoundError
now. I think the sensible thing to do here would be to create another new error, NodeNotFoundError
, that is raised when a non-specific function is used (e.g., just open
) to try and open either an array or a group.
@@ -34,6 +35,10 @@ class GroupNotFoundError(BaseZarrError, FileNotFoundError): | |||
_msg = "No group found in store {!r} at path {!r}" | |||
|
|||
|
|||
class ArrayNotFoundError(BaseZarrError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also sub-class FileNotFoundError to make sure we retain backwards compatibility.
it might be helpful to check out #3012, which unfortunately was too bloated to merge |
Fixes #2961
TODO:
docs/user-guide/*.rst
changes/