Skip to content

Commit fa49c05

Browse files
authored
Make warning message clearer when assigning to PandasMultiIndex (#10610)
1 parent 6ef7eed commit fa49c05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xarray/core/coordinates.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,10 +1027,10 @@ def drop_indexed_coords(
10271027
if isinstance(idx, PandasMultiIndex) and idx_drop_coords == {idx.dim}:
10281028
idx_drop_coords.update(idx.index.names)
10291029
emit_user_level_warning(
1030-
f"updating coordinate {idx.dim!r} with a PandasMultiIndex would leave "
1030+
f"updating coordinate {idx.dim!r}, which is a PandasMultiIndex, would leave "
10311031
f"the multi-index level coordinates {list(idx.index.names)!r} in an inconsistent state. "
1032-
f"This will raise an error in the future. Use `.drop_vars({list(idx_coords)!r})` before "
1033-
"assigning new coordinate values.",
1032+
f"This will raise an error in the future. Use `.drop_vars({list(idx_coords)!r})` "
1033+
"to drop the coordinates' values before assigning new coordinate values.",
10341034
FutureWarning,
10351035
)
10361036

0 commit comments

Comments
 (0)