From 41949209b6cfb0d5c25d000b1e0c5739b513385c Mon Sep 17 00:00:00 2001 From: Oriol Abril-Pla Date: Fri, 24 Feb 2023 21:16:43 +0100 Subject: [PATCH] Update error message when saving multiindex (#7475) * update error message on saving multiindex * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Deepak Cherian --- xarray/conventions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xarray/conventions.py b/xarray/conventions.py index 74dc686ee95..780172879c6 100644 --- a/xarray/conventions.py +++ b/xarray/conventions.py @@ -197,10 +197,11 @@ def ensure_not_multiindex(var: Variable, name: T_Name = None) -> None: if isinstance(var, IndexVariable) and isinstance(var.to_index(), pd.MultiIndex): raise NotImplementedError( "variable {!r} is a MultiIndex, which cannot yet be " - "serialized to netCDF files " - "(https://github.com/pydata/xarray/issues/1077). Use " - "reset_index() to convert MultiIndex levels into coordinate " - "variables instead.".format(name) + "serialized to netCDF files. Instead, either use reset_index() " + "to convert MultiIndex levels into coordinate variables instead " + "or use https://cf-xarray.readthedocs.io/en/latest/coding.html.".format( + name + ) )