Repository navigation
fix:Dataframe.merge loses data when there are 128 or 129 partitions - #12430
Merged
crusaderky merged 6 commits intoJun 6, 2026
Merged
Conversation
Contributor
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 25 files + 1 25 suites +1 6h 55m 25s ⏱️ + 20m 31s Results for commit 867df83. ± Comparison against base commit 9124454. ♻️ This comment has been updated with latest results. |
1 task
Collaborator
|
The issue is not when there are more than 128 partitions. I've simplified the PR and updated the title. Thank you! |
crusaderky
approved these changes
Jun 6, 2026
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.
Summary
partitioning_indexchoosingint8whennpartitions=129, causing partition 128 to be stored as-128and rows to be silently dropped during P2P shuffle routing.Root cause
np.min_scalar_type(-(npartitions - 1))picksint8for 129 partitions because-128fits inint8, but the logical bucket128cannot be represented as a non-negativeint8.Fixes #12427
Test plan
pytest dask/dataframe/tests/test_shuffle.py -k partitioning_index