Suggest installing dask when not discovered by ChunkManager#7963
Closed
TomNicholas wants to merge 2 commits intopydata:mainfrom
Closed
Suggest installing dask when not discovered by ChunkManager#7963TomNicholas wants to merge 2 commits intopydata:mainfrom
TomNicholas wants to merge 2 commits intopydata:mainfrom
Conversation
dcherian
reviewed
Jul 5, 2023
| possible_missing_package_name = type(chunked_arr).__module__.split(".")[0] | ||
| raise TypeError( | ||
| f"Could not find a Chunk Manager which recognises type {type(chunked_arr)}" | ||
| f"Could not find a Chunk Manager which recognises type {type(chunked_arr)}. Try installing the {possible_missing_package_name} package." |
Contributor
There was a problem hiding this comment.
Suggested change
| f"Could not find a Chunk Manager which recognises type {type(chunked_arr)}. Try installing the {possible_missing_package_name} package." | |
| f"Could not find a Chunk Manager which recognises type {type(chunked_arr)}. Try searching for and installing a {possible_missing_package_name}_xarray package." |
? Since you could have cubed installed but not cubed-xarray
Member
Author
There was a problem hiding this comment.
Fair point, but then would that be more confusing if the problem is that the user doesn't have Dask installed? Because then it would point them towards a non-existent dask_xarray package...
Member
Author
|
This came up again in #8301. To be honest, given there are only 2 known chunkmanagers at the moment, maybe we should just special case the error message to tell the user exactly which package to install? |
Contributor
|
Works for me! |
andersy005
reviewed
Oct 16, 2023
| ] | ||
| if not selected: | ||
| possible_missing_package_name = type(chunked_arr).__module__.split(".")[0] | ||
| raise TypeError( |
Member
There was a problem hiding this comment.
considering that the error is actually caused by a missing package, could we consider
- using a more general exception, such as
ModuleNotFoundError, instead of the currentTypeError? - or implementing a custom exception specifically for this purpose?
2 tasks
Member
Author
|
Closing in favour of #9676 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
whats-new.rstNew functions/methods are listed inapi.rst