From 1bc7ad8e6751eb93de01410d0c851cec0f0d8c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Fri, 16 Sep 2022 17:49:46 -0400 Subject: [PATCH 1/2] CLN: MultiIndex.drop_duplicates --- pandas/core/indexes/multi.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index dd63ea94d5211..61f61464db42c 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -3864,10 +3864,6 @@ def set_names(self, names, level=None, inplace: bool = False) -> MultiIndex | No rename = set_names - @deprecate_nonkeyword_arguments(version=None, allowed_args=["self"]) - def drop_duplicates(self, keep: str | bool = "first") -> MultiIndex: - return super().drop_duplicates(keep=keep) - # --------------------------------------------------------------- # Arithmetic/Numeric Methods - Disabled From 564ebcf6e0a658a94010feff5f9c822ba78b9ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Fri, 16 Sep 2022 18:58:37 -0400 Subject: [PATCH 2/2] adjust test --- pandas/tests/indexes/multi/test_duplicates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/indexes/multi/test_duplicates.py b/pandas/tests/indexes/multi/test_duplicates.py index 6832fb77ed30d..ea21f28409699 100644 --- a/pandas/tests/indexes/multi/test_duplicates.py +++ b/pandas/tests/indexes/multi/test_duplicates.py @@ -332,7 +332,7 @@ def test_multi_drop_duplicates_pos_args_deprecation(): idx = MultiIndex.from_arrays([[1, 2, 3, 1], [1, 2, 3, 1]]) msg = ( "In a future version of pandas all arguments of " - "MultiIndex.drop_duplicates will be keyword-only" + "Index.drop_duplicates will be keyword-only" ) with tm.assert_produces_warning(FutureWarning, match=msg): result = idx.drop_duplicates("last")