Skip to content

BUG: clearer HDFStore error for min_itemsize on MultiIndex columns (GH-12154)#65602

Open
jbrockmendel wants to merge 2 commits into
pandas-dev:mainfrom
jbrockmendel:bug-12154
Open

BUG: clearer HDFStore error for min_itemsize on MultiIndex columns (GH-12154)#65602
jbrockmendel wants to merge 2 commits into
pandas-dev:mainfrom
jbrockmendel:bug-12154

Conversation

@jbrockmendel
Copy link
Copy Markdown
Member

Summary

  • Per-column min_itemsize is fundamentally unsupported for DataFrames with MultiIndex columns because data_columns are unsupported on that axis. Today the constraint is hit accidentally and emits one of two opaque errors:
    • min_itemsize={1: 20}"min_itemsize has the key [1] which is not an axis or data_column"
    • min_itemsize={(1, 'a'): 20}"cannot have non-object label DataIndexableCol"
  • Surface the real constraint in validate_data_columns and point users at the working min_itemsize={'values': N} form.

closes #12154

Test plan

  • Added test_append_min_itemsize_multiindex_columns covering the level-0-key form, the tuple-key form, and the 'values' round-trip.
  • Full pandas/tests/io/pytables/test_append.py passes locally.

🤖 Generated with Claude Code

jbrockmendel and others added 2 commits May 11, 2026 13:05
…H#12154)

Per-column min_itemsize is unsupported with MultiIndex columns because
data_columns themselves are unsupported on that axis. Previously the
user hit one of two opaque errors ("not an axis or data_column" for a
level-0 key, "cannot have non-object label DataIndexableCol" for a tuple
key). Surface the actual constraint up front in validate_data_columns
and point users at the min_itemsize={'values': N} workaround.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"min_itemsize" doesn't work for MultiIndex columns in table format

1 participant