From 267a17d0c3f9241a2df99502053b4feb21a6dca4 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Fri, 15 Mar 2024 21:50:01 -0600 Subject: [PATCH] Fix dropping of muiltiindexes xref #8844 Closes https://github.com/xarray-contrib/flox/issues/342 --- xarray/core/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index b4c00b66ed8..10bf1466156 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -5867,7 +5867,7 @@ def drop_vars( for var in names_set: maybe_midx = self._indexes.get(var, None) if isinstance(maybe_midx, PandasMultiIndex): - idx_coord_names = set(maybe_midx.index.names + [maybe_midx.dim]) + idx_coord_names = set(list(maybe_midx.index.names) + [maybe_midx.dim]) idx_other_names = idx_coord_names - set(names_set) other_names.update(idx_other_names) if other_names: