diff --git a/xarray/namedarray/parallelcompat.py b/xarray/namedarray/parallelcompat.py index dd555fe200a..58fbd22c78c 100644 --- a/xarray/namedarray/parallelcompat.py +++ b/xarray/namedarray/parallelcompat.py @@ -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] diff --git a/xarray/tests/test_parallelcompat.py b/xarray/tests/test_parallelcompat.py index dbe40be710c..fd4737f9a2a 100644 --- a/xarray/tests/test_parallelcompat.py +++ b/xarray/tests/test_parallelcompat.py @@ -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 @@ -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