Skip to content

fix(deps): cap pyarrow below 26 on Python 3.12 - #140

Merged
tkislan merged 7 commits into
mainfrom
tk/cap-pyarrow-python-3.12
Oct 27, 2026
Merged

tkislan merged 7 commits into
mainfrom
tk/cap-pyarrow-python-3.12

Conversation

@tkislan

@tkislan tkislan commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #139.

Fresh installs of the toolkit on Python 3.12 get pyarrow 26.0.0, which refuses to import with NumPy 1.x, while 3.12 is pinned to numpy<2. pyarrow 26 doesn't declare a numpy requirement, so pip doesn't catch the conflict, and the chart and SQL functions then fail to import. This PR caps pyarrow at <26 on Python 3.12 only.

Changes

  • pyproject.toml: the 3.12 requirement becomes pyarrow>=23.0.1,<26, with a comment explaining why.
  • poetry.lock: only content-hash changes. The locked pyarrow for Python 3.12 and later is already 24.0.0, so locked environments are unchanged. A plain poetry lock also drops about 20 unrelated duplicate entries (pydantic, pyzmq, shapely, …), the same thing it does on main (see fix(deps): resolve pip-audit failures #133), so those were left alone.
  • ci.yml: new wheel-install-check job (Wheel Install Check). Every other job that installs the toolkit's dependencies takes them from poetry.lock, which is why CI didn't notice this break. For Python 3.10–3.14, the job builds the wheel, installs it with the [server] extra into a clean venv without the lock, and checks that DeepnoteChart, execute_sql and execute_sql_with_connection_json are exported. It checks the names because safe_import swallows import errors, so import deepnote_toolkit alone still succeeds when they fail. The job always resolves the latest upstream releases, so an upstream break can turn it red on PRs that didn't cause it.

Python 3.10 and 3.11 already cap pyarrow at 18 or lower, and 3.13 and later require numpy>=2.1, so no other version needs this.

Why not NumPy 2 on 3.12

Allowing NumPy 2 on 3.12, as 3.13 and later already do, would also fix this. But it moves every 3.12 environment to a new NumPy major version, which breaks user code that relies on NumPy 1.x APIs removed in 2.0. It would also need pandas 2.2.2 or later on 3.12, where the floor is currently 2.1.0. That deserves its own PR.

The trade-off: until 3.12 moves to NumPy 2, it can't get pyarrow fixes released only in 26 or later.

Testing

  • Before: on Python 3.12.15, pip install "deepnote-toolkit[server]==2.9.0" from PyPI into a fresh venv resolves numpy 1.26.4 with pyarrow 26.0.0, and DeepnoteChart, execute_sql and execute_sql_with_connection_json fail to import. A wheel built from main behaves the same.
  • After: a wheel built from this branch resolves pyarrow 25.0.1 in a fresh 3.12 venv, and all three import.
  • The chart, SQL, duckdb, SQL caching and artifacts unit tests pass in that fresh 3.12 environment (pyarrow 25.0.1, numpy 1.26.4): 379 passed, 2 skipped. Both skips also happen on main and are unrelated to pyarrow.
  • poetry check --lock passes.
  • Wheel Install Check, locally: the job's install and check pass on Python 3.10.22, 3.11.17, 3.12.15, 3.13.13 and 3.14.8, and all 19 exports import on each. Against a 3.12 install of main's wheel, the same check fails with deepnote_toolkit is missing exports: ['DeepnoteChart', 'execute_sql', 'execute_sql_with_connection_json'].
  • actionlint 1.7.12 and the pre-commit hooks pass on ci.yml.

The unit-test jobs install from poetry.lock, which this PR doesn't change, so they run the same environment as main. The fix is confirmed by the new Wheel Install Check job.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HwkxN8YriHhdXBwMc4sd8h

Summary by CodeRabbit

  • Bug Fixes
    • Python 3.12 environments now use PyArrow versions below 26, matching the supported NumPy version range.
  • Tests
    • Added automated checks that build and install the package on Python 3.10–3.14, then verify that the installed package and its key modules can be imported successfully.

pyarrow 26.0.0 refuses to import with NumPy 1.x but doesn't declare a
numpy requirement, and Python 3.12 is pinned to numpy<2. Fresh installs
on 3.12 therefore resolved numpy 1.26.4 with pyarrow 26.0.0, and the
chart and SQL functions failed to import.

The locked pyarrow (24.0.0) already satisfies the cap, so poetry.lock
only gets a new content-hash.

Fixes #139

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwkxN8YriHhdXBwMc4sd8h
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

📦 Python package built successfully!

  • Version: 2.9.0.dev9+f332360
  • Wheel: deepnote_toolkit-2.9.0.dev9+f332360-py3-none-any.whl
  • Install:
    pip install "deepnote-toolkit @ https://deepnote-staging-runtime-artifactory.s3.amazonaws.com/deepnote-toolkit-packages/2.9.0.dev9%2Bf332360/deepnote_toolkit-2.9.0.dev9%2Bf332360-py3-none-any.whl"

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.17%. Comparing base (71ec5f4) to head (6931101).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #140   +/-   ##
=======================================
  Coverage   78.17%   78.17%           
=======================================
  Files         120      120           
  Lines        6837     6837           
  Branches      990      990           
=======================================
  Hits         5345     5345           
  Misses       1182     1182           
  Partials      310      310           
Flag Coverage Δ
combined 78.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@deepnote-bot

deepnote-bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🚀 Review App Deployment Started

📝 Description 🌐 Link / Info
🌍 Review application ra-140
🔑 Sign-in URL Click to sign-in
📊 Application logs View logs
🔄 Actions Click to redeploy
🚀 ArgoCD deployment View deployment
⏰ Last deployed 2026-10-27 13:17:44 (UTC)
📜 Deployed commit 39aefeee0d49252f2c9814e7ecfab6d41161e16d
🛠️ Toolkit version f332360

tkislan and others added 4 commits October 23, 2026 21:34
Every job that installs the toolkit's dependencies takes them from
poetry.lock, so none of them saw pyarrow 26 break fresh pip installs on
Python 3.12. The new job builds the wheel, installs it with its [server]
extra into a clean venv without the lock on Python 3.10-3.14, and checks
that DeepnoteChart, execute_sql and execute_sql_with_connection_json are
exported. It checks the names because safe_import swallows import errors,
so `import deepnote_toolkit` alone still succeeds when they fail.

Refs #139

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwkxN8YriHhdXBwMc4sd8h
The one-line python -c check was hard to read. Running it as a heredoc
script lets it use an if block and exit with a plain message instead of
an AssertionError traceback, and leaves room for comments on why the
step leaves the checkout and why it checks the exports by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwkxN8YriHhdXBwMc4sd8h
The unit-test jobs install the project from the checkout and never build
or install a wheel, so "wheel install" is what sets this job apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwkxN8YriHhdXBwMc4sd8h
@tkislan
tkislan marked this pull request as ready for review October 25, 2026 08:38
@tkislan
tkislan requested a review from a team as a code owner October 25, 2026 08:38
@tkislan
tkislan requested a review from mfranczel October 25, 2026 08:38
@tkislan

tkislan commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0a2c75fb-cd99-42c8-a1fc-b21b1fb8d3f5
Commits

Reviewing files that changed from the base of the PR and between e157c8d and 6931101.

Files selected for processing: 3
  • .flake8
  • .github/workflows/ci.yml
  • scripts/check_toolkit_imports.py

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.

Walkthrough

The Python 3.12 PyArrow requirement now caps the version below 26. CI builds and installs the wheel with the server extra on Python 3.10–3.14, then runs a script that imports deepnote_toolkit and its listed APIs.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: m1so

Merge Risk: Minimal · up to 69311

The dependency cap and fresh-wheel import check address the reported Python 3.12 installation failure. No merge-blocking issue remains identified.

Pre-merge checks: Passed 5 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Updates Docs Inconclusive The PR changes dependency constraints and CI only; it adds no documentation files. The required primary documentation and roadmap are in linked repositories, which are unavailable for inspection in th… Verify and update the relevant documentation in the deepnote/deepnote OSS repository and the roadmap in the deepnote/deepnote-internal repository. Re-run this check when those repositories are available.
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: capping pyarrow below version 26 for Python 3.12.
Linked Issues check Passed Issue #139 requires a fix for fresh Python 3.12 installs with NumPy <2 and pyarrow 26. pyproject.toml now declares pyarrow>=23.0.1,<26 for Python 3.12. The wheel-install check installs without `po…
Out of Scope Changes check Passed The changes stay within issue #139. The dependency constraint prevents the reported incompatible resolution. The CI job and import-check script provide automated coverage for the fresh-wheel installat…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Full details: Linked Issues check

Explanation

Issue #139 requires a fix for fresh Python 3.12 installs with NumPy <2 and pyarrow 26. pyproject.toml now declares pyarrow&gt;=23.0.1,&lt;26 for Python 3.12. The wheel-install check installs without poetry.lock and imports the affected toolkit APIs across Python 3.10–3.14. The reported Python 3.12 validation resolves pyarrow 25.0.1 and imports the affected APIs.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #139. The dependency constraint prevents the reported incompatible resolution. The CI job and import-check script provide automated coverage for the fresh-wheel installation path. The .flake8 change supports that script. No unrelated change is demonstrated.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)

Full details: Updates Docs

Explanation

The PR changes dependency constraints and CI only; it adds no documentation files. The required primary documentation and roadmap are in linked repositories, which are unavailable for inspection in this review.

Resolution

Verify and update the relevant documentation in the deepnote/deepnote OSS repository and the roadmap in the deepnote/deepnote-internal repository. Re-run this check when those repositories are available.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 26, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 27, 2026
@tkislan
tkislan requested a review from m1so October 27, 2026 11:28
Comment thread .github/workflows/ci.yml Outdated
…all check

`import deepnote_toolkit` loads its public names through safe_import, which
logs a failed import instead of raising, so the inline heredoc checked three
of them with hasattr. scripts/check_toolkit_imports.py imports every name
deepnote_toolkit/__init__.py loads, plus the artifacts functions, directly,
so any broken dependency fails the job with its own traceback.

Running the script by path keeps the checkout off sys.path, so the step no
longer needs to cd out of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwkxN8YriHhdXBwMc4sd8h
@tkislan
tkislan requested a review from m1so October 27, 2026 13:12
@tkislan
tkislan enabled auto-merge (squash) October 27, 2026 13:15
@tkislan
tkislan merged commit 3fafbfd into main Oct 27, 2026
43 checks passed
@tkislan
tkislan deleted the tk/cap-pyarrow-python-3.12 branch October 27, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fresh installs on Python 3.12 get pyarrow 26, which needs NumPy 2, so charts and SQL fail to import

3 participants