question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Raise a better error when an array/store already exists

See original GitHub issue

It 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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Carreaucommented, Sep 14, 2020

#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.

0reactions
rabernatcommented, Sep 14, 2020

👍 We often hit these errors with cloud storage (e.g. s3fs) and users get very confused.

@eric-czech’s suggestions make sense to me.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found