Pandas version checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have confirmed this bug exists on the latest version of pandas.

  • [X] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
import pandas._testing as tm

mi = pd.MultiIndex.from_product([[1, 2], ["a", "b"]])
rt = tm.round_trip_pickle(mi)

>>> mi._id == rt._id
False

(in practice we check mi._id is rt._id which is also False, but which I think is unlikely to be fix-able)

modin (and I expect dask) pickles/unpickles Index objects which later go through concat and end up having to do expensive .equals checks which could be made more performant if the _id attributes were preserved through the pickle roundtrip.

Comment From: jbrockmendel

I'm not convinced this is possible. Closing.