Mola-maker opened a new pull request, #53520:
URL: https://github.com/apache/arrow/pull/53520

   ### Rationale for this change
   
   Fixes #53519.
   
   `StringArray.from_buffers()` and `LargeStringArray.from_buffers()` reject 
valid arrays with counters above INT32_MAX, while `Array.from_buffers()` 
accepts the identical buffers and reads the correct final value. The 
specialized helpers narrow length, null_count and offset to C `int`, even 
though Arrow ArrayData uses 64-bit counters.
   
   ### What changes are included in this PR?
   
   Use `int64_t` for 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?
   
   - Compiled both original and candidate `pyarrow.lib` bindings 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.
   - Ubuntu/Python 3.12.14/GCC 15.2 and native Arch/Omarchy/Python 3.14.8/GCC 
16.2.1 each reproduce **six specialized OverflowErrors** with six valid generic 
controls. The fixed bindings produce **six valid specialized arrays**, 
including correct final values and null counts.
   - Each environment: **8 focused tests passed** with 
`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 --check` passes. Independent Codex review found no confirmed 
blockers. Final issue/PR searches found no equivalent fix.
   - The PR base was updated after main added unrelated Parquet encoding 
support; the entire Python subtree is unchanged from the source used for 
validation.
   
   [Exact dependencies, installation logs, source-build logs, hashes and 
reproduction 
programs](https://github.com/Mola-maker/arrow/tree/b1aa9dd93e5fefdb041e4a1b49d0be4a10be0238).
   
   These unedited screenshots come from `omarchy capture screenshot fullscreen 
save` in 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:
   
   ![Native Arrow original binding: six valid controls, six specialized 
OverflowErrors](https://raw.githubusercontent.com/Mola-maker/arrow/b1aa9dd93e5fefdb041e4a1b49d0be4a10be0238/before.png)
   
   After:
   
   ![Native Arrow fixed binding: six valid controls and six valid specialized 
arrays](https://raw.githubusercontent.com/Mola-maker/arrow/b1aa9dd93e5fefdb041e4a1b49d0be4a10be0238/after.png)
   
   ### 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:**
   
   - [ ] Human
   - [x] AI
   
   **Reviewed before submission by:**
   
   - [ ] Human
   - [x] AI
   - [ ] Not reviewed
   
   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to