Skip to content

Commit 02e3ca2

Browse files
authored
drop_vars: use emit_user_level_warning (pydata#10528)
1 parent d79fc9d commit 02e3ca2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

xarray/core/dataset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5807,11 +5807,10 @@ def drop_vars(
58075807
other_names.update(idx_other_names)
58085808
if other_names:
58095809
names_set |= set(other_names)
5810-
warnings.warn(
5810+
emit_user_level_warning(
58115811
f"Deleting a single level of a MultiIndex is deprecated. Previously, this deleted all levels of a MultiIndex. "
58125812
f"Please also drop the following variables: {other_names!r} to avoid an error in the future.",
58135813
DeprecationWarning,
5814-
stacklevel=2,
58155814
)
58165815

58175816
assert_no_index_corrupted(self.xindexes, names_set)

0 commit comments

Comments
 (0)