Raise a better error when an array/store already exists
See original GitHub issueIt would be helpful for users and downstream libraries if the error thrown when attempting to create an array that already exists on disk was more specific. For example, this error isn’t very clear and it isn’t easy to wrap in error handling logic:
import zarr
zarr.create((10, 10), store='/tmp/test.zarr')
zarr.create((10, 10), store='/tmp/test.zarr')
# ValueError: path '' contains an array
This could perhaps raise a FileExistsError or at least include a message that describes the condition more clearly.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
java - Dealing with an ArrayStoreException - Stack Overflow
Unfortunately, the array definition in Java is somehow broken. String[] is considered a subtype of Object[] , but that is wrong! For a...
Read more >zarr-python/convenience.py at main - GitHub
How to handle keys that already exist in the destination store. If. 'raise' then a CopyError is raised on the first key already...
Read more >JavaScript Array Store Methods - DevExtreme - DevExpress
This section describes methods that control the ArrayStore. ... (error) => { /* Handle the "error" here */ }; );; // Gets the...
Read more >Zarr storage specification version 2 — zarr 2.8.1 documentation
Below an “array store” refers to any system implementing this interface. ... created at path “foo” and the root of the store, if...
Read more >dask.array.to_zarr - Dask documentation
If given array already exists, overwrite=False will cause an error, ... Raises. ValueError. If arr has unknown chunk sizes, which is not supported...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
#590 from 3 weeks ago does already include subclasses of ValueError with more informative names and make the stacktrace more explicit as to where the error come from.
Though we do need to remove the helper function in favor of custom exception and I’m was waiting for #546 to get in as it did conflict and was bigger.
Once this is in we can more precise error messages, but there will still be some layer of indirection with the store.
👍 We often hit these errors with cloud storage (e.g. s3fs) and users get very confused.
@eric-czech’s suggestions make sense to me.