Skip to content

Commit 0b47042

Browse files
committed
Raise KeyError instead of ValueError.
I should be using Pull Requests!
1 parent 9147c89 commit 0b47042

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cf_xarray/accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ def __getitem__(self, key: Union[str, List[str]]):
921921
try:
922922
names = axis_coord_mapper(self._obj, k)
923923
except KeyError as e:
924-
raise ValueError(
924+
raise KeyError(
925925
f"Receive multiple variables for key {k!r}. Expected only one. Please pass a list [{k!r}] instead to get all variables matching {k!r}."
926926
)
927927
raise e

0 commit comments

Comments
 (0)