Skip to content

BUG: regresssion in 3.0rc: cannot save df with MultiIndex to HDF #63412

@gdementen

Description

@gdementen

Pandas version checks

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

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

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

Reproducible Example

>>> import pandas as pd
>>> pd.__version__
'3.0.0rc0'
>>> index = pd.MultiIndex.from_tuples([('a', 'x'), ('b', 'y')], names=['level1', 'level2'])
>>> df = pd.DataFrame({'value': [1, 2]}, index=index)
>>> index.dtypes
level1    str
level2    str
dtype: object
>>> df.to_hdf('test.h5', key='test')
NotImplementedError: Saving a MultiIndex with an extension dtype is not supported.

While on Pandas 2.3.3, it worked:

>>> import pandas as pd
>>> pd.__version__
'2.3.3'
>>> index = pd.MultiIndex.from_tuples([('a', 'x'), ('b', 'y')], names=['level1', 'level2'])
>>> df = pd.DataFrame({'value': [1, 2]}, index=index)
>>> index.dtypes
level1    object
level2    object
dtype: object
>>> df.to_hdf('test.h5', key='test')
>>> # no error

Issue Description

Saving a dataframe with a MultiIndex to HDF does not work anymore

Expected Behavior

Saving is possible 😉

Installed Versions

Details

INSTALLED VERSIONS

commit : 1a3230d
python : 3.13.7
python-bits : 64
OS : Windows
OS-release : 11
Version : 10.0.26200
machine : AMD64
processor : Intel64 Family 6 Model 154 Stepping 4, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_Belgium.1252

pandas : 3.0.0rc0
numpy : 2.3.5
dateutil : 2.9.0.post0
pip : 25.3
Cython : None
sphinx : None
IPython : 9.7.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : 1.4.2
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : None
lxml.etree : None
matplotlib : 3.10.6
numba : None
numexpr : 2.14.1
odfpy : None
openpyxl : 3.1.5
psycopg2 : None
pymysql : None
pyarrow : 21.0.0
pyiceberg : None
pyreadstat : None
pytest : 8.4.2
python-calamine : None
pytz : 2025.2
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : 3.10.2
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
qtpy : 2.4.3
pyqt5 : None

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO HDF5read_hdf, HDFStoreRegressionFunctionality that used to work in a prior pandas versionStringsString extension data type and string data

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions