Skip to content

fix(pyo3): allow pyarrow 24-26 so consumers can clear CVE-2026-92287 - #501

Merged
vuanhphung merged 7 commits into
mainfrom
fix/pyarrow-ceiling-26
Dec 2, 2026
Merged

vuanhphung merged 7 commits into
mainfrom
fix/pyarrow-ceiling-26

Conversation

@shiminlin-db

@shiminlin-db shiminlin-db commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

databricks-sql-kernel declared pyarrow>=23.0.1,<24 for Python 3.10+, so pip install "databricks-sql-connector[kernel]" "pyarrow>=26" was unresolvable (databricks/databricks-sql-python#1076). pyarrow 26.0.0 is the first release without CVE-2026-92287 (apache/arrow#51349, a Parquet KMS token disclosure affecting 8.0.0 <= pyarrow < 26.0.0). This binding never calls that Parquet decryption path, but dependency scanners flag every affected pyarrow, and the ceiling kept consumers from upgrading.

  • pyo3/pyproject.toml: ceiling <24 -> <27 for Python >= 3.10. Floor unchanged. Keeps the major-version upper bound the pinning policy (cited in the file) requires. pyarrow 26 needs Python >= 3.11, so 3.10 resolves to 25.x; the 3.9 range (>=14,<19) is untouched. packaging is declared in the dev group because the new test imports it.
  • pyo3/tests/test_dependency_bounds.py: reads the installed Requires-Dist and fails if the 3.10+ range excludes 26.0.0 or the installed pyarrow.
  • pyo3/NEXT_CHANGELOG.md: Unreleased entry.

Compatibility

No API change, and the floor is unchanged, so any install that pins pyarrow keeps resolving. The behavior change is for unpinned [kernel] installs: they move from pyarrow 23.x to 26.x on Python 3.11+ (25.x on 3.10), three majors of a package the user's own code may import. Opt-out is a user-side pin (pyarrow<24), which still resolves; a code-level switch does not apply to a dependency range. The binding exports batches through arrow-pyarrow 59's ToPyArrow, which calls pyarrow's private _import_from_c API.

Validation

  • Published 1.5.0 wheel + pyarrow 26.0.1 on Python 3.12, + pyarrow 24.0.0 on 3.12, and + pyarrow 25.0.1 on 3.10: pytest tests/ --ignore tests/test_dependency_bounds.py in pyo3/ -> 21 passed, 37 skipped (live tier, no creds) each, including the loopback Arrow handoff tests in test_fetch.py. (The new test is excluded there because it fails by design against the shipped <24 metadata.)
  • databricks-sql-python main @ 087b2bff (v4.9.0 plus 17 commits) real-kernel unit tests (-m realkernel, test_kernel_async_readers.py + test_session.py) with kernel 1.5.0 + pyarrow 26.0.1 on 3.12: 8 passed.
  • New test: fails against the shipped <24 metadata on 3.12 and 3.10; passes against installed metadata carrying <27.
  • uv pip compile pyo3/pyproject.toml: 3.12 -> pyarrow 26.0.1, 3.10 -> 25.0.1, 3.9 -> 18.1.0; --group dev resolves packaging 26.3.
  • Not done locally: building the wheel from this branch (no Rust toolchain on the preparing machine). The PyO3 Checks matrix (uv sync resolves the newest pyarrow inside the bound, then maturin develop + pytest on 3.9-3.14) is the build-from-source check for this PR.

Follow-up

databricks-sql-connector already requires databricks-sql-kernel>=1.4.0,<2.0.0 behind [kernel], so publishing a kernel release with this bound is what unblocks pip install "databricks-sql-connector[kernel]" "pyarrow>=26"; no connector change is needed for that. The connector's dev poetry.lock (pyarrow 23.0.1) and its pyproject.toml comment about the kernel's pyarrow<24 constraint get refreshed in a separate connector PR once the release is out.

Refs databricks/databricks-sql-python#1076

This pull request and its description were written by Isaac.

shiminlin-db and others added 3 commits November 23, 2026 20:55
The published wheel declared pyarrow>=23.0.1,<24 for Python 3.10+, which
made `pip install "databricks-sql-connector[kernel]" "pyarrow>=26"`
unresolvable; pyarrow 26.0.0 is the first release without
CVE-2026-92287 (apache/arrow#51349). The ceiling moves to <27, keeping
the major-version bound the pinning policy requires. Python 3.10
resolves to 25.x because pyarrow 26 requires Python 3.11.

Adds tests/test_dependency_bounds.py, which reads the installed
Requires-Dist and fails if the 3.10+ range drops back below 26.0.0 or
excludes the installed pyarrow.

Refs databricks/databricks-sql-python#1076

Signed-off-by: Shimin Lin <135086178+shiminlin-db@users.noreply.github.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Shimin Lin <135086178+shiminlin-db@users.noreply.github.com>
…packaging

Unreleased wheel changes belong in pyo3/NEXT_CHANGELOG.md; CHANGELOG.md
only moves at release time. The entry now also names the behavior change
for unpinned [kernel] installs (pyarrow 23 -> 26 on 3.11+, 25 on 3.10)
and the pin that opts out.

The pyproject comment now states what was tested (24.0.0, 25.0.1, 26.0.1)
instead of a blanket stability claim, and the dev group declares
packaging, which tests/test_dependency_bounds.py imports.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Shimin Lin <135086178+shiminlin-db@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 Low

Looks good, with 1 low concern. The ceiling bump keeps the required major-version upper bound, nothing in the repo still mentions <24, and the new metadata test runs in CI because maturin develop installs dist-info and the dev group includes packaging.

Comment thread pyo3/pyproject.toml Resolved
shiminlin-db and others added 2 commits November 23, 2026 23:06
`uv sync` resolves the newest pyarrow inside the bound, so after widening
the range to `>=23.0.1,<27` the default matrix legs never exercised 23.x.
One extra leg (Python 3.12) pins pyarrow==23.0.1 after the sync so a
kernel change that breaks on the oldest supported pyarrow fails CI. The
default legs keep their check names.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Shimin Lin <135086178+shiminlin-db@users.noreply.github.com>
Resolves the pyo3-checks.yml conflict with the fork-CI split (#497):
keeps main's job `if:` and permissions, and carries the pyarrow floor
leg into both the trusted and the fork job so they stay aligned.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Shimin Lin <135086178+shiminlin-db@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

✅ No issues identified.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

✅ No issues identified.

@vuanhphung vuanhphung added the engineer-bot Apply to an issue to trigger the engineer-bot; on a PR to enable engineer follow-up label Dec 2, 2026
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

✅ No issues identified.

🔀 1 finding considered and dismissed by the judge
  • 🔵 Low .github/workflows/pyo3-checks.yml:94 — The new floor leg covers only the 3.10+ floor (23.0.1). The 3.9 range (>=14,<19) still runs only at 18.x, so a kernel change that breaks pyarrow 14 still won'
    Judge's evidence: so the default legs only ever see the top of '>=23.0.1,<27'.

@vuanhphung
vuanhphung enabled auto-merge December 2, 2026 08:23
@vuanhphung
vuanhphung added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 9f5cd98 Dec 2, 2026
30 of 31 checks passed

This branch was successfully deployed

1 active deployment
azure-prod — dce4e0fa Deployed Dec 2, 2026 by vuanhphung via followup #4997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineer-bot Apply to an issue to trigger the engineer-bot; on a PR to enable engineer follow-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants