Repository navigation
GH-53519: [Python] Use 64-bit counters in string buffer factories - #53520
Closed
Mola-maker wants to merge 1 commit into
Closed
Mola-maker wants to merge 1 commit into
Mola-maker wants to merge 1 commit into
Conversation
|
|
Member
|
Thanks for the PR. I’m closing it because Arrow’s contributor guidelines require that AI-generated code be reviewed and understood by the person submitting it:
Once you’ve reviewed the changes and can own them yourself, you’re welcome to open a new PR. |
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.
Rationale for this change
Fixes #53519.
StringArray.from_buffers()andLargeStringArray.from_buffers()reject valid arrays with counters above INT32_MAX, whileArray.from_buffers()accepts the identical buffers and reads the correct final value. The specialized helpers narrow length, null_count and offset to Cint, even though Arrow ArrayData uses 64-bit counters.What changes are included in this PR?
Use
int64_tfor all three counters in both factories. Extend normal string/binary round-trip tests to both classes and add six valid large-counter regressions with real sparse mappings, generic-factory controls and final-value checks. The large tests use the existing large_memory group and import mmap inside the test so unsupported platforms can skip them without affecting collection. No buffer layout or runtime dependency changes.Are these changes tested?
pyarrow.libbindings from source against the official PyArrow 26.0.0 C++ SDK; all 29 packaged pxd ABI descriptions matched. The whole C++ SDK was not rebuilt.PYARROW_TEST_LARGE_MEMORY=1; full array module: 332 passed, 40 skipped using default groups. All six new native regressions fail against original source.git diff --checkpasses. Independent Codex review found no confirmed blockers. Final issue/PR searches found no equivalent fix.Exact dependencies, installation logs, source-build logs, hashes and reproduction programs.
These unedited screenshots come from
omarchy capture screenshot fullscreen savein the same running disposable Arch/Omarchy guest. The terminal program reruns the actual Arrow calls against the installed native binding and prints its SHA256. Sparse valid buffers reserve address space while process RSS remains around 57–79 MiB.Before:
After:
Are there any user-facing changes?
The specialized string factories now accept valid 64-bit counters consistently with the generic factory. Existing valid inputs and string offset-buffer widths retain their behavior.
Was AI used for this PR?
PR code and description written by:
Reviewed before submission by:
Code, tests and descriptions used Codex, with independent AI code review and actual source-build/runtime validation in both environments. No human code review is claimed.