Skip to content

Commit 58516b3

Browse files
committed
CLN: Remove internal classes from MultiIndex pickle.
FrozenNDArray had made it into the MI pickle. No reason to do that and just complicates pickle compat going forward. Now they just output ndarray instead (which also avoids the unnecessary nested pickle previously occurring).
1 parent ec54354 commit 58516b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/index.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2458,8 +2458,9 @@ def __contains__(self, key):
24582458
def __reduce__(self):
24592459
"""Necessary for making this object picklable"""
24602460
object_state = list(np.ndarray.__reduce__(self))
2461-
subclass_state = (list(self.levels), list(
2462-
self.labels), self.sortorder, list(self.names))
2461+
subclass_state = ([lev.view(np.ndarray) for lev in self.levels],
2462+
[label.view(np.ndarray) for label in self.labels],
2463+
self.sortorder, list(self.names))
24632464
object_state[2] = (object_state[2], subclass_state)
24642465
return tuple(object_state)
24652466

0 commit comments

Comments
 (0)