fix: require pyarrow>=17.0.0#4152
Merged
Merged
Conversation
pyarrow's utf8/ascii_split_whitespace kernel reads one byte past the end of the input values buffer (SplitWhitespaceUtf8Finder::Find -> UTF8Decode). Awkward's to_arrow hands pyarrow exactly-sized, zero-copy numpy buffers (not 64-byte padded as Arrow recommends), so the over-read lands in adjacent heap memory instead of zero padding. When that byte is non-whitespace, trailing whitespace is mis-split, e.g. " abc " -> ['', 'abc', ' '] instead of ['', 'abc', '', '']. This surfaced as a rare flake in test_split_whitespace on the minimal CI job (pyarrow==14.0.0). Confirmed via MALLOC_PERTURB_ + valgrind, and bisected: wrong on 14/15/16, fixed upstream in Arrow 17.0.0. Raise the runtime floor and test requirements to 17.0.0. Assisted-by: ClaudeCode:claude-opus-4.8
Follow-ups to requiring pyarrow>=17.0.0: the skipif in test_2650_arrow_array_highlevel can never trigger now, and docs requirements still pinned the old >=7.0.0 floor. Assisted-by: ClaudeCode:claude-opus-4.8
Codecov Report❌ Patch coverage is
Additional details and impacted files
|
ikrommyd
approved these changes
Jun 23, 2026
ariostas
approved these changes
Jun 23, 2026
ianna
enabled auto-merge (squash)
June 24, 2026 08:19
Member
|
https://github.com/scikit-hep/awkward/actions/runs/29146832891/job/86529775737?pr=4103 |
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.
🤖 AI text below 🤖
Fixes #4151.
What
Raise the supported pyarrow floor to 17.0.0 (runtime guard in
_connect/pyarrow/__init__.py, plusrequirements-test-{minimal,full,nogil}.txt).Why
tests/test_2616_use_pyarrow_for_strings.py::test_split_whitespaceflaked on theminimalCI job (Python 3.10,pyarrow==14.0.0), mis-splitting" abc "as['', 'abc', ' ']instead of['', 'abc', '', ''].Root cause is an upstream pyarrow kernel over-read:
utf8_split_whitespace(SplitWhitespaceUtf8Finder::Find→arrow::util::UTF8Decode) reads one byte past the end of the input values buffer. Awkward'sto_arrowhands pyarrow exactly-sized, zero-copy numpy buffers (not 64-byte padded as Arrow recommends), so the over-read lands in adjacent heap memory rather than zero padding. When that byte is non-whitespace, the trailing whitespace run is mis-split — a rare, memory-state-dependent flake (and a genuine correctness bug for any user on pyarrow 12–16).Confirmed with
MALLOC_PERTURB_=255+ allocator churn (deterministic reproduction) and valgrind (Invalid read of size 1 at UTF8Decode … StringSplitExec<LargeStringType,…>, "0 bytes after a block of size 86" — awkward's input char buffer). Bisected: wrong on 14.0.0 / 15.0.2 / 16.1.0, fixed in 17.0.0+.Notes
pyarrow 17.0.0 or later requirederror instead of silently producing wrong results.to_arrow) was considered but is a broader change on a hot path for what is a fixed-upstream bug; bumping the floor is the simpler fix. See Flaky test_split_whitespace: pyarrow <17 over-reads unpadded buffers from to_arrow #4151 for the full investigation.AI-assisted (Claude Code): diagnosis and this change.