pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.63k stars 1.09k forks source link

more friendly error message in case no chunk manager is available #9676

Open keewis opened 4 weeks ago

keewis commented 4 weeks ago

The current error message when trying to use a chunked-array related method without actually having a chunk manager available is:

unrecognized chunk manager dask - must be one of: []

That's pretty confusing, so this catches the case where no chunk manager is available and raises an error with guidance on how to fix that.

max-sixty commented 4 weeks ago

Much better!

mathause commented 4 weeks ago

Thanks - I had a PR on this but don't mind closing mine in favor of this one. There is also #7963 which seems related.

keewis commented 4 weeks ago

wow, I don't know how I missed two open PRs that aim to do something similar in different ways. Which one do we take?

If we merge this one your PR might still be valuable since it also changes the error message if there are chunk managers but not the one that was requested.

dcherian commented 2 weeks ago

Shall we merge?

TomNicholas commented 1 week ago

wow, I don't know how I missed two open PRs that aim to do something similar in different ways. Which one do we take?

Sorry for dropping the ball on reviewing / merging these guys 😞

Let's merge this one.

If we merge this one your PR might still be valuable since it also changes the error message if there are chunk managers but not the one that was requested.

This change would also be useful but is much less likely to come up.

TomNicholas commented 3 days ago

If you change the other ValueError to ImportError on line 109 of parallelcompat.py the failing test should pass.

dcherian commented 1 day ago

I'm planning to release on Friday US time. Would be good to wrap this up