Skip to content

friendlier error messages for missing chunk managers - #9676

Merged
keewis merged 31 commits into
pydata:mainfrom
keewis:no-chunkmanager
Dec 29, 2024
Merged

friendlier error messages for missing chunk managers#9676
keewis merged 31 commits into
pydata:mainfrom
keewis:no-chunkmanager

Conversation

@keewis

@keewiskeewis commented Oct 24, 2024

Copy link
Copy Markdown
Collaborator

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.

  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst

@max-sixty

Copy link
Copy Markdown
Collaborator

Much better!

@mathause

Copy link
Copy Markdown
Collaborator

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

keewis commented Oct 25, 2024

Copy link
Copy Markdown
CollaboratorAuthor

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

Copy link
Copy Markdown
Contributor

Shall we merge?

Comment threadxarray/tests/test_parallelcompat.py Outdated
Comment threaddoc/whats-new.rst Outdated
@TomNicholasTomNicholas added topic-error reporting topic-chunked-arrays Managing different chunked backends, e.g. dask labels Nov 8, 2024
Comment threadxarray/namedarray/parallelcompat.py Outdated
Comment threadxarray/namedarray/parallelcompat.py Outdated
@TomNicholas

TomNicholas commented Nov 8, 2024

Copy link
Copy Markdown
Member

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.

Co-authored-by: Tom Nicholas <tom@cworthy.org>
Comment threadxarray/namedarray/parallelcompat.py Outdated
Comment threadxarray/tests/test_parallelcompat.py Outdated
Comment threadxarray/tests/test_parallelcompat.py Outdated
@dcheriandcherian mentioned this pull request Nov 18, 2024
6 tasks

@TomNicholasTomNicholas left a comment

Copy link
Copy Markdown
Member

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.

@keewis

keewis commented Nov 22, 2024

Copy link
Copy Markdown
CollaboratorAuthor

@dcherian, @TomNicholas, this should be ready for a final review (and can hopefully still make it into the release looks like I was late by a couple minutes)

@dcherian

Copy link
Copy Markdown
Contributor

we can always release more!

@keewis

Copy link
Copy Markdown
CollaboratorAuthor

the failing zarr tests were because of the automatic chunking in open_zarr (chunks="auto")

@keewiskeewis changed the title more friendly error message in case no chunk manager is availablefriendlier error messages for missing chunk managersNov 22, 2024
@TomNicholas

Copy link
Copy Markdown
Member

@keewis I made some very minor changes - feel free to merge this.

Comment threadxarray/namedarray/parallelcompat.py Outdated
@keewis

Copy link
Copy Markdown
CollaboratorAuthor

sorry for letting this stagnate for a month, I've been busy. I'll merge this tomorrow, should anyone be around and wish to review one final time.

@keewiskeewis added the plan to merge Final call for comments label Dec 28, 2024
@keewis
keewis merged commit dead70f into pydata:mainDec 29, 2024
@keewis
keewis deleted the no-chunkmanager branch December 29, 2024 14:03
dcherian added a commit to dcherian/xarray that referenced this pull request Mar 19, 2025
* main: (63 commits)
Fix zarr upstream tests (pydata#9927)
Update pre-commit hooks (pydata#9925)
split out CFDatetimeCoder, deprecate use_cftime as kwarg (pydata#9901)
dev whats-new (pydata#9923)
Whats-new 2025.01.0 (pydata#9919)
Silence upstream Zarr warnings (pydata#9920)
time coding refactor (pydata#9906)
fix warning from scipy backend guess_can_open on directory (pydata#9911)
Enhance and move ISO-8601 parser to coding.times (pydata#9899)
Edit serialization error message (pydata#9916)
friendlier error messages for missing chunk managers (pydata#9676)
Bump codecov/codecov-action from 5.1.1 to 5.1.2 in the actions group (pydata#9915)
Rewrite interp to use `apply_ufunc` (pydata#9881)
Skip dask rolling (pydata#9909)
Explicitly configure ReadTheDocs build to use conf.py (pydata#9908)
Cache pre-existing Zarr arrays in Zarr backend (pydata#9861)
Optimize idxmin, idxmax with dask (pydata#9800)
remove unused "type: ignore" comments in test_plot.py (fixed in matplotlib 3.10.0) (pydata#9904)
move scalar-handling logic into `possibly_convert_objects` (pydata#9900)
Add missing DataTree attributes to docs (pydata#9876)
...
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan to mergeFinal call for commentstopic-chunked-arraysManaging different chunked backends, e.g. dasktopic-error reporting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@keewis@max-sixty@mathause@dcherian@TomNicholas@shoyer