Skip to content

Commit 7322222

Browse files
authored
CLN: Remove param _set_identity in MultiIndex (#36786)
1 parent 3787913 commit 7322222

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

pandas/core/indexes/multi.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ def __new__(
278278
copy=False,
279279
name=None,
280280
verify_integrity: bool = True,
281-
_set_identity: bool = True,
282281
):
283282

284283
# compat with Index
@@ -312,10 +311,7 @@ def __new__(
312311
new_codes = result._verify_integrity()
313312
result._codes = new_codes
314313

315-
if _set_identity:
316-
result._reset_identity()
317-
318-
return result
314+
return result._reset_identity()
319315

320316
def _validate_codes(self, level: List, code: List):
321317
"""
@@ -1071,7 +1067,6 @@ def _shallow_copy(
10711067
codes=None,
10721068
sortorder=None,
10731069
names=lib.no_default,
1074-
_set_identity: bool = True,
10751070
):
10761071
if names is not lib.no_default and name is not lib.no_default:
10771072
raise TypeError("Can only provide one of `names` and `name`")
@@ -1091,7 +1086,6 @@ def _shallow_copy(
10911086
sortorder=sortorder,
10921087
names=names,
10931088
verify_integrity=False,
1094-
_set_identity=_set_identity,
10951089
)
10961090
result._cache = self._cache.copy()
10971091
result._cache.pop("levels", None) # GH32669
@@ -1119,7 +1113,6 @@ def copy(
11191113
codes=None,
11201114
deep=False,
11211115
name=None,
1122-
_set_identity=False,
11231116
):
11241117
"""
11251118
Make a copy of this object. Names, dtype, levels and codes can be
@@ -1180,7 +1173,6 @@ def copy(
11801173
codes=codes,
11811174
names=names,
11821175
sortorder=self.sortorder,
1183-
_set_identity=_set_identity,
11841176
)
11851177

11861178
if dtype:

0 commit comments

Comments
 (0)