-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
friendlier error messages for missing chunk managers #9676
base: main
Are you sure you want to change the base?
Conversation
Much better! |
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. |
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. |
Shall we merge? |
Sorry for dropping the ball on reviewing / merging these guys 😞 Let's merge this one.
This change would also be useful but is much less likely to come up. |
Co-authored-by: Tom Nicholas <[email protected]>
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.
While this could be further improved in cases like cubed being installed but dask not (when there would not be 0 chunkmanagers installed), this PR on it's own addresses the confusing error that 99% of users are encountering so should be merged asap.
If you change the other ValueError to ImportError on line 109 of parallelcompat.py the failing test should pass. |
I'm planning to release on Friday US time. Would be good to wrap this up |
Trying to summarize what we discussed in the meeting on Wednesday:
This would be okay, because right now there are only 3 chunkmanagers we know of, one which ships with xarray. Outside of these 3 a slightly less helpful error message is fine. This allows our error messages to explicitly point to the correct package to install, e.g. We questioned the wisdom of even creating the whole entrypoint system in the first place, but also said that removing it is a separable issue for later, and the priority should be to improve the error messages first. I can't really remember what we decided about |
Thanks for the summary.
I don't think we decided anything, but it would make sense to me to raise a |
we probably also want to prefer the more specific error over the generic |
@dcherian, @TomNicholas, this should be ready for a final review ( |
we can always release more! |
the failing |
for more information, see https://pre-commit.ci
@keewis I made some very minor changes - feel free to merge this. |
raise ValueError( | ||
f"unrecognized chunk manager {manager} - must be one of: {list(chunkmanagers)}" | ||
f"unrecognized chunk manager {manager} - must be one of: {list(available_chunkmanagers)}" |
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.
re-reading this, it looks like only this error message is only describing the issue, not offering advice. What do you think about extending it?
f"unrecognized chunk manager {manager} - must be one of: {list(available_chunkmanagers)}" | |
f"unrecognized chunk manager {manager} - must be one of: {list(available_chunkmanagers)}" | |
" (you can extend this list by installing more packages that provide a chunk manager)." |
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.
Sounds good. You could also change it to say "must be one of the installed chunkmanagers: {{list(available_chunkmanagers)}}
" which would be a bit clearer about what the list represents.
The current error message when trying to use a chunked-array related method without actually having a chunk manager available is:
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.
whats-new.rst