BUG: IntervalIndex cannot be round-tripped pickled #35658
Labels
Interval
Interval data type
IO Pickle
read_pickle, to_pickle
Regression
Functionality that used to work in a prior pandas version
Milestone
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
Having recently updated to v1.1.0 from v1.0.5, it seems IntervalIndex is no longer preserving the closure of the intervals as being left or right. When unpickling the IntervalIndex, the closure is reset to the default value of "right". This seems similar to the serialisation issues of #32037 and #35420, but those seem to be for older versions of the master branch.
Expected Output
Output of
pd.show_versions()
python -c "import pandas as pd; pd.show_versions()"
INSTALLED VERSIONS
commit : d9fff27
python : 3.7.3.final.0
python-bits : 64
OS : Linux
OS-release : 3.10.0-1062.7.1.el7.x86_64
Version : #1 SMP Mon Dec 2 17:33:29 UTC 2019
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 19.3.1
setuptools : 45.2.0
Cython : None
pytest : 4.3.0
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.1
IPython : 7.17.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.0
numexpr : 2.7.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : None
tables : 3.6.1
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : 0.48.0
The text was updated successfully, but these errors were encountered: