Skip to content

BUG: Fix MultiIndex.equals regression regarding code bit-width (#65700)#65701

Open
anzinmhd wants to merge 8 commits into
pandas-dev:mainfrom
anzinmhd:fix-multiindex-equals-65700
Open

BUG: Fix MultiIndex.equals regression regarding code bit-width (#65700)#65701
anzinmhd wants to merge 8 commits into
pandas-dev:mainfrom
anzinmhd:fix-multiindex-equals-65700

Conversation

@anzinmhd
Copy link
Copy Markdown
Contributor

@anzinmhd anzinmhd commented May 21, 2026

Fixes a regression in MultiIndex.equals where equality was incorrectly failing when comparing codes with different bit-widths (e.g., int32 vs int64). This changes the equality check to be value-based rather than byte-based.
Issue: Closes #65700

@anzinmhd
Copy link
Copy Markdown
Contributor Author

pre-commit.ci autofix

@jorisvandenbossche
Copy link
Copy Markdown
Member

Thanks for the PR! To preserve the speedup of #65192, we might still want to do the bytes-based comparison when the dtypes are the same.

(and then maybe can add a array_equivalent_int helper that encapsulates that logic)

@jorisvandenbossche jorisvandenbossche added this to the 3.1 milestone May 22, 2026
@anzinmhd
Copy link
Copy Markdown
Contributor Author

pre-commit.ci autofix

@anzinmhd anzinmhd force-pushed the fix-multiindex-equals-65700 branch from af1df55 to 4e24235 Compare May 23, 2026 08:54
@anzinmhd
Copy link
Copy Markdown
Contributor Author

@jorisvandenbossche Thanks for the feedback! I've moved the _array_equivalent_int helper to the module level to avoid the inheritance issue and preserve the performance win from #65192.

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.

REGR (main): MultiIndex.equals now takes into account bitwidth of the codes

2 participants