Skip to content

chore: Bump pyo3 to 0.30 and arrow to 60.1 - #552

Merged
kylebarron merged 3 commits into
mainfrom
kyle/arro3-pyo3-0.30
Oct 28, 2026
Merged

kylebarron merged 3 commits into
mainfrom
kyle/arro3-pyo3-0.30

Conversation

@kylebarron

@kylebarron kylebarron commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

Move arro3 to pyo3 0.30 and arrow/parquet 60.1. Stacked on #551.

  • pyo3 and numpy 0.30, with the new releases of the pyo3-dependent crates: pyo3-async-runtimes 0.30, pyo3-bytes 0.8, pyo3-object_store 0.13, and pyo3-file 0.18. pyo3-file 0.18 is the kyle/pyo3-0.30 commit (8ec53a9) plus a version bump, so this uses the crates.io release instead of a git rev.
  • arrow and parquet 60.1, and object_store 0.14. These have to move together with pyo3: pyo3-object_store 0.13 uses object_store 0.14, and arro3-io passes its store to parquet's ParquetObjectReader, so parquet must use the same object_store.
  • pyo3-arrow goes back to being a path dependency.

Code changes for arrow 60.1:

Wheels: rust-numpy 0.30 doesn't compile for free-threaded Python before 3.15 on 32-bit platforms, so the linux and musllinux x86 and armv7 builds no longer include cp314t wheels. 0.9.1 shipped those four. Free-threaded 3.15 is still built there.

A new test in tests/core/test_ffi.py, running here against the pyo3-arrow from #551, sends an error that a pyarrow producer raises mid-stream through pyo3-arrow's stream import code, and checks that the message arrives. The export direction needs the separate GIL fix in #555, so that test isn't here: without the fix, the pyarrow reader it leaves behind can be freed during a later arro3 call and segfault.

Closes #538, closes #542.

#543 stays open: besides object_store 0.14, it moves the root workspace to thiserror 2.

Testing

  • The root workspace steps of ci.yml pass locally, plus cargo check -p arro3-io --no-default-features, the configuration the emscripten wheels use.
  • Wheels built from this branch pass pytest tests locally (macOS arm64) on 3.12 and 3.13 (208 passed each). On 3.13 and up, the dev group installs pytest-freethreaded, which runs each test 200 times across 10 threads. CI runs 3.11 through 3.14t.
  • One of 13 full-suite runs on 3.14, on an earlier version of this stack, failed test_min_max_datetime_with_timezone, a test this PR doesn't modify. It didn't come back in 77 further runs on this branch or in 25 runs on arro3 0.9.1, and I didn't capture its error message.
  • arrow 60.1 needs rustc 1.88. The emscripten jobs build with 1.93.0 on 3.14 (Pyodide's pin) and with this repo's nightly-2026-06-01 override on 3.13.

Follow-up

Replace ParquetObjectReader with arro3's own AsyncFileReader, as parquet recommends. That would also stop tying arro3-io's object_store version to parquet's, the coupling that kept this upgrade from landing on arrow 59. read_parquet_async has no Python tests yet, so that PR should add one.

🤖 Written by Claude Code

@kylebarron
kylebarron added this pull request to stack #554 October 28, 2026 15:12
@github-actions github-actions Bot added the chore label Oct 28, 2026
@kylebarron
kylebarron force-pushed the kyle/arro3-pyo3-0.30 branch from f84a144 to 78acf9a Compare October 28, 2026 15:59
@kylebarron
kylebarron force-pushed the kyle/arro3-pyo3-0.30 branch 2 times, most recently from ed23c28 to 402109f Compare October 28, 2026 16:39
@kylebarron
kylebarron force-pushed the kyle/arro3-pyo3-0.30 branch from 402109f to 5f8e576 Compare October 28, 2026 18:12
@kylebarron
kylebarron removed this pull request from stack #554 October 28, 2026 18:13
@kylebarron
kylebarron added this pull request to stack #556 October 28, 2026 18:13
@kylebarron
kylebarron force-pushed the kyle/arro3-pyo3-0.30 branch from 5f8e576 to 72cb9f9 Compare October 28, 2026 18:45
@kylebarron
kylebarron removed this pull request from stack #556 October 28, 2026 18:46
@kylebarron
kylebarron added this pull request to stack #558 October 28, 2026 18:46
@kylebarron
kylebarron removed this pull request from stack #558 October 28, 2026 19:00
@kylebarron
kylebarron added this pull request to stack #560 October 28, 2026 19:01
Base automatically changed from kyle/pyo3-arrow-arrow-60 to main October 28, 2026 19:06
kylebarron and others added 3 commits October 28, 2026 15:06
Move arro3 to pyo3 0.30 now that its pyo3-dependent crates have
releases: pyo3-async-runtimes 0.30, pyo3-bytes 0.8, pyo3-object_store
0.13 and pyo3-file 0.18. pyo3-object_store 0.13 uses object_store 0.14,
and arro3-io hands its store to parquet's `ParquetObjectReader`, so
arrow and parquet move to 60.1 (object_store 0.14) at the same time.
pyo3-arrow goes back to being a path dependency.

Code changes for arrow 60.1:

- `OffsetBuffer::first` now returns the first offset directly, since an
  `OffsetBuffer` is never empty.
- parquet has deprecated `ParquetObjectReader` since 59.2.0, in favor of
  implementing `AsyncFileReader` (apache/arrow-rs#10308). Allow the
  deprecation for now; replacing it deserves its own PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
pyo3-arrow imports chunked arrays and array readers through its own C
stream reader, which the arrow 60.1 port moved onto the new callback
accessors. No test sent an error through it. Add one: a pyarrow
producer's mid-stream error must surface with its message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rust-numpy 0.30 refuses to compile for free-threaded Python before 3.15
on 32-bit platforms ("free-threaded Python on 32bit platforms is only
supported from 3.15+"). Build the version-specific wheels for linux and
musllinux x86 and armv7 without `-i 3.14t`. 3.15t is still built there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kylebarron
kylebarron force-pushed the kyle/arro3-pyo3-0.30 branch from 72cb9f9 to 95564cc Compare October 28, 2026 19:06

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment thread arro3-io/src/parquet.rs
Comment on lines +71 to +73
// `ParquetObjectReader` is deprecated in favor of implementing `AsyncFileReader` directly:
// https://github.com/apache/arrow-rs/issues/10308
#[allow(deprecated)]

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please create an issue to track this work, then work on a PR in the background to fix it

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This reply was written by Claude (Claude Code), not by @kylebarron.

Tracked in #561 and fixed in #563, which copies parquet's examples/object_store.rs reader into arro3-io and removes this #[allow(deprecated)].

🤖 Written by Claude Code

@kylebarron
kylebarron merged commit 33458b7 into main Oct 28, 2026
22 checks passed
@kylebarron
kylebarron deleted the kyle/arro3-pyo3-0.30 branch October 28, 2026 19:16
kylebarron added a commit to ump45nose/arro3 that referenced this pull request Oct 28, 2026
Since kylebarron#552, the workspace builds arro3-core against the in-tree pyo3-arrow,
so the skip is no longer needed. Also add the PR number to the pyo3-arrow
changelog entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kylebarron added a commit that referenced this pull request Oct 29, 2026
* feat(pyo3-arrow): convert interval scalars to Python objects

`PyScalar::as_py` hit a `todo!()` for every interval type, so calling
`as_py()` on an interval scalar raised a pyo3 PanicException. Convert
each interval unit to plain Python values holding its components:

- MonthDayNano -> (months, days, nanoseconds)
- DayTime -> (days, milliseconds)
- YearMonth -> int number of months

Closes #409

Signed-off-by: Vincent <[email protected]>

* test: skip the interval as_py test until pyo3-arrow is unpinned

CI builds arro3 against pyo3-arrow pinned at git rev 5475f33, which still
hits todo!() for interval scalars, so the new test panics there. Skip it
until the workspace moves to pyo3 0.30 and uses the in-tree pyo3-arrow.

Signed-off-by: Vincent <[email protected]>

* test: re-enable the month_day_nano interval as_py test

Since #552, the workspace builds arro3-core against the in-tree pyo3-arrow,
so the skip is no longer needed. Also add the PR number to the pyo3-arrow
changelog entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat: return month_day_nano intervals as a MonthDayNano named tuple

pyarrow's `as_py()` returns `pyarrow.MonthDayNano`, a tuple subclass with
`months`, `days` and `nanoseconds` attributes. `arro3.core.MonthDayNano` is
a `NamedTuple` with the same fields and repr. It compares equal both to
pyarrow's value and to the plain tuple that nanoarrow returns. pyo3-arrow
imports it from `arro3.core`, like its `to_arro3` exports do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: shorten the MonthDayNano docstring

Apply review suggestions.

Co-authored-by: Kyle Barron <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat: return day_time intervals as a DayTime named tuple

`DayTime` has the same fields as arrow-rs's `IntervalDayTime`: `days` and
`milliseconds`. Like `MonthDayNano`, it compares equal to the plain tuple
that nanoarrow returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: check interval as_py against nanoarrow

pyarrow can't create day_time or year_month interval arrays, so add
nanoarrow as a dev dependency. It builds them from Python values, and its
`to_pylist()` is the reference. Locked with uv 0.12 so the lockfile stays
at revision 3; `uv lock --check` with uv 0.8.24 passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: don't import nanoarrow on free-threaded Python

nanoarrow 0.9.0 hasn't declared free-threading support, so importing it
re-enables the GIL for the whole run. Importing it at module level meant
the 3.14t job ran every test with the GIL enabled. Import it in a fixture
that skips on free-threaded builds instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Signed-off-by: Vincent <[email protected]>
Co-authored-by: Kyle Barron <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Kyle Barron <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant