lll-hhh opened a new pull request, #55717: URL: https://github.com/apache/arrow/pull/55717
### Rationale for this change Fixes #44643. When a Python struct row is converted, its child builders are appended one at a time. If a later child returns `CapacityError`, earlier children may already contain part of that row. The chunker then finishes the current chunk, and `MapBuilder::FinishInternal` aborts because the key and item builders have different lengths. ### What changes are included in this PR? - Make `PyStructConverter` recover from a child `CapacityError` by backfilling any missing child values and the struct parent. This leaves a complete placeholder row for the chunker to slice away. - Mark the struct converter as requiring rewind on overflow and stop `Chunker` from retrying when no logical rows were committed to the current chunk. - Release the new reference returned by `PyMemoryView_GetContiguous()` so a temporary memoryview/mmap can be released after conversion. - Add regressions for the abort, successful automatic chunking of a map of strings, and memoryview buffer release. ### Are these changes tested? Yes, against an editable Arrow C++/PyArrow build in WSL: - Focused regressions with large-memory tests enabled: `3 passed`. - `python -m pytest -q pyarrow/tests/test_convert_builtin.py`: `612 passed, 72 skipped, 2 xfailed`. - Arrow C++/PyArrow shared build completed successfully. - `clang-format==18.1.8 --dry-run --Werror` passed on all modified C++ files. ### Are there any user-facing changes? No API changes. Oversized map/struct conversions now either split into chunks or raise `ArrowCapacityError` instead of aborting the Python process. **This PR contains a "Critical Fix".** This fixes a process-wide SIGABRT on an API-contract-valid input path. ### Was AI used for this PR? In accordance to the AI generation guidelines, AI was used for implementation and tests. The change was reproduced, debugged, reviewed, and validated against a local Arrow build before submission. **PR code and description written by:** - [ ] Human - [x] AI **Reviewed before submission by:** - [ ] Human - [x] AI - [ ] Not reviewed * GitHub Issue: #44643 -- 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]
