Skip to content

Fix nightly MultiIndex test failure and new test warnings - #11655

Merged
headtr1ck merged 4 commits into
pydata:mainfrom
headtr1ck:fix-multiindex-sel-test-pandas-nightly
Oct 1, 2026
Merged

headtr1ck merged 4 commits into
pydata:mainfrom
headtr1ck:fix-multiindex-sel-test-pandas-nightly

Conversation

@headtr1ck

@headtr1ck headtr1ck commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Nightly failure (#11652): TestPandasMultiIndex::test_sel expects an IndexError when the key has more entries than the MultiIndex has levels. pandas nightly (3.1.0.dev) now raises KeyError: 'Key length (3) exceeds index depth (2)' there, while released pandas raises an (accidental) IndexError: list index out of range. The test now accepts both.

New warnings (not present in CI a week ago):

  • UserWarning: Warning: converting a masked element to nan. from the new lines plot tests (Add LineCollection plot #7173): _line passed the masked linewidths from cbook._combine_masks directly to LineCollection, which matplotlib converts to nan with a warning, both when drawing and in legend_elements. Masked linewidths are now passed as nan explicitly, and legend_elements skips nan linewidths, so the legend is unchanged.
  • ZarrUserWarning: Automatic shard shape inference is experimental from test_write_regular_shards_still_works['auto'], which uses shards="auto" on purpose. The warning is now ignored for that case only.

Checklist

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
      Tools: Claude Code (Claude Opus 5.5)

[This is Claude Code on behalf of Michael Niklas]

🤖 Generated with Claude Code

headtr1ck and others added 2 commits October 1, 2026 10:01
pandas nightly raises a KeyError instead of an IndexError when the key
is longer than the number of MultiIndex levels.

Fixes pydata#11652

Co-authored-by: Claude <noreply@anthropic.com>
Pass missing linewidths to LineCollection as nan instead of masked
values, which matplotlib converts with a "converting a masked element to
nan" warning, and skip them in the legend.

Ignore zarr's warning about experimental automatic shard shape inference
in the test that uses shards="auto" on purpose.

Co-authored-by: Claude <noreply@anthropic.com>
@headtr1ck
headtr1ck merged commit 569f2fb into pydata:main Oct 1, 2026
45 checks passed
@headtr1ck
headtr1ck deleted the fix-multiindex-sel-test-pandas-nightly branch October 1, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚠️ Nightly upstream-dev CI failed ⚠️

2 participants