Skip to content

Conversation

@zacharym-collins
Copy link
Contributor

Summary

  • Fixed NotImplementedError when saving MultiIndex with StringDtype to HDF5.
  • Added regression test in pandas/tests/io/pytables/test_store.py.
  • Enabled existing tests in test_put.py, test_read.py, and test_round_trip.py that were previously skipped for StringDtype.

)
# GH 63412
if isinstance(lev.dtype, StringDtype):
lev = lev.astype(object)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you replace this with pass, does _convert_index below already convert this data correctly without the astype?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does. I'll make the modification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mroeschke Checks passed. I used a different implementation to avoid the two if blocks, I think this is better style, unless you disagree.

@mroeschke mroeschke added IO HDF5 read_hdf, HDFStore Strings String extension data type and string data labels Dec 18, 2025
@jorisvandenbossche jorisvandenbossche added this to the 3.0 milestone Dec 18, 2025
@mroeschke mroeschke merged commit b95f65b into pandas-dev:main Dec 18, 2025
42 checks passed
@mroeschke
Copy link
Member

Thanks @zacharym-collins

@zacharym-collins zacharym-collins deleted the fix-hdf-multiindex-string branch December 18, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IO HDF5 read_hdf, HDFStore Strings String extension data type and string data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants