Repository navigation
Closes #5137: bug in MultiIndex.ak.collect - #5154
Merged
ajpotts merged 1 commit intoDec 18, 2025
Merged
Conversation
ajpotts
force-pushed
the
5137_bug_in_MultiIndex.ak.collect
branch
from
December 12, 2025 17:24
c9d4482 to
f70e3bc
Compare
ajpotts
marked this pull request as ready for review
December 12, 2025 18:10
drculhane
approved these changes
Dec 17, 2025
drculhane
left a comment
Contributor
There was a problem hiding this comment.
Confirmed that it fixes the bug. Nicely done.
jaketrookman
approved these changes
Dec 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description: Fix
IndexAccessor.collectfor MultiIndex and Add TestsThis pull request improves the behavior of
ArkoudaIndexAccessor.collect()whenhandling
pandas.MultiIndexobjects, especially those with Arkouda‑backed levels.Summary of Changes
1. Correct MultiIndex Collection Logic
Previously,
collect()attempted to rebuild a MultiIndex by iterating overidx.levels, which fails to preserve row ordering and duplicates and can breakfor certain Arkouda‑backed level types.
This PR replaces that logic with:
This ensures:
_dataattributes of extension arrays.2. New Test:
test_collect_multiindex_preserves_all_rowsA parametrized test verifies behavior for both:
arkouda_backed = False(plain pandas MultiIndex)arkouda_backed = True(Arkouda-backed MultiIndex)The test asserts:
.equals()holds for the plain-pandas case.3. Minor Test Cleanup
pytestimport..to_list()comparison for row-level correctness.Motivation
The old behavior caused incorrect reconstruction of MultiIndex objects,
particularly losing duplicate rows or failing to preserve row ordering when
levels were Arkouda-backed. This surfaced as failures in new tests validating
faithful round‑trip conversion.
Impact
.collect()behaves predictably regardless of backend.File Changes
arkouda/pandas/extension/_index_accessor.pytests/pandas/extension/index_accessor.pyCloses #5137: bug in MultiIndex.ak.collect