Skip to content
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

missing chunkmanager: update error message #8803

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion xarray/namedarray/parallelcompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def guess_chunkmanager(
if isinstance(manager, str):
if manager not in chunkmanagers:
raise ValueError(
f"unrecognized chunk manager {manager} - must be one of: {list(chunkmanagers)}"
f"requested chunk manager '{manager}' not found in available chunk managers"
f"({list(chunkmanagers)}) - do you need to install '{manager}'?"
)

return chunkmanagers[manager]
Expand Down
6 changes: 4 additions & 2 deletions xarray/tests/test_parallelcompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_get_chunkmanger(self, register_dummy_chunkmanager) -> None:
assert isinstance(chunkmanager, DummyChunkManager)

def test_fail_on_nonexistent_chunkmanager(self) -> None:
with pytest.raises(ValueError, match="unrecognized chunk manager foo"):
with pytest.raises(ValueError, match="requested chunk manager 'foo' not found"):
guess_chunkmanager("foo")

@requires_dask
Expand All @@ -163,7 +163,9 @@ def test_get_dask_if_installed(self) -> None:

@pytest.mark.skipif(has_dask, reason="requires dask not to be installed")
def test_dont_get_dask_if_not_installed(self) -> None:
with pytest.raises(ValueError, match="unrecognized chunk manager dask"):
with pytest.raises(
ValueError, match="requested chunk manager 'dask' not found"
):
guess_chunkmanager("dask")

@requires_dask
Expand Down
Loading