Skip to content

GH-48473: [CI][Python] Require numpy 2.0 - #50769

Open
alippai wants to merge 8 commits into
apache:mainfrom
alippai:alippai-numpy-20
Open

GH-48473: [CI][Python] Require numpy 2.0#50769
alippai wants to merge 8 commits into
apache:mainfrom
alippai:alippai-numpy-20

Conversation

@alippai

@alippai alippai commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Require Numpy 2.0 to support newer features, allow newer numpy API/ABI

What changes are included in this PR?

  • Numpy 2.0+ requirement
  • Pandas 2.2.2+ requirement (first wheel compatible with numpy 2.0)
  • Pyodide 0.27.1 usage (numpy 2.0 api)

Are there any user-facing changes?

Yes, in contrast to pyarrow 25, after merging this PR pyarrow 26 can't be used with Numpy 1.x or pandas 2.0-2.2.1

This PR includes breaking changes to public APIs.

This PR was created using GPT-5.6-Sol-xhigh, every line read & reviewed by me.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

⚠️ GitHub issue #48473 has been automatically assigned in GitHub to PR creator.

@alippai

alippai commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@tadeja @rok @raulcd @jorisvandenbossche this is ready for review. The failure seems to be an unrelated arrow flight timeout. Once this is on master, I'll file a new StringDType from/to conversion PR.

@kou

kou commented Aug 3, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g python

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Revision: d0a51cc

Submitted crossbow builds: ursacomputing/crossbow @ actions-764bbcb6f5

Task Status
example-python-minimal-build-fedora-conda GitHub Actions
example-python-minimal-build-ubuntu-venv GitHub Actions
test-conda-python-3.11 GitHub Actions
test-conda-python-3.11-dask-latest GitHub Actions
test-conda-python-3.11-dask-upstream_devel GitHub Actions
test-conda-python-3.11-hdfs-2.9.2 GitHub Actions
test-conda-python-3.11-hdfs-3.2.1 GitHub Actions
test-conda-python-3.11-hypothesis GitHub Actions
test-conda-python-3.11-pandas-2.2.2-numpy-2.0.2 GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
test-conda-python-3.12 GitHub Actions
test-conda-python-3.12-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.13 GitHub Actions
test-conda-python-3.13-pandas-latest-numpy-2.1.0 GitHub Actions
test-conda-python-3.13-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.14 GitHub Actions
test-conda-python-3.14-cpython-debug GitHub Actions
test-conda-python-3.14-pandas-nightly-numpy-nightly GitHub Actions
test-conda-python-3.14-pandas-upstream_devel-numpy-nightly GitHub Actions
test-conda-python-emscripten GitHub Actions
test-debian-13-python-3-amd64 GitHub Actions
test-debian-13-python-3-i386 GitHub Actions
test-fedora-42-python-3 GitHub Actions
test-ubuntu-24.04-python-3 GitHub Actions

@raulcd raulcd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @alippai for working on this. Changes LGTM in general, let me lauch extra CI and get the ok from @pitrou @jorisvandenbossche @AlenkaF

Comment thread .github/workflows/python.yml
@raulcd

raulcd commented Aug 3, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit wheel-cp313

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Revision: d0a51cc

Submitted crossbow builds: ursacomputing/crossbow @ actions-449ef0ee7b

Task Status
wheel-macos-monterey-cp313-cp313-amd64 GitHub Actions
wheel-macos-monterey-cp313-cp313-arm64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313-amd64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313-arm64 GitHub Actions
wheel-musllinux-1-2-cp313-cp313-amd64 GitHub Actions
wheel-musllinux-1-2-cp313-cp313-arm64 GitHub Actions
wheel-windows-cp313-cp313-amd64 GitHub Actions

@raulcd

raulcd commented Aug 3, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit wheel-cp311

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Revision: d0a51cc

Submitted crossbow builds: ursacomputing/crossbow @ actions-012e7c747c

Task Status
wheel-macos-monterey-cp311-cp311-amd64 GitHub Actions
wheel-macos-monterey-cp311-cp311-arm64 GitHub Actions
wheel-manylinux-2-28-cp311-cp311-amd64 GitHub Actions
wheel-manylinux-2-28-cp311-cp311-arm64 GitHub Actions
wheel-musllinux-1-2-cp311-cp311-amd64 GitHub Actions
wheel-musllinux-1-2-cp311-cp311-arm64 GitHub Actions
wheel-windows-cp311-cp311-amd64 GitHub Actions

@rok rok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this @alippai !

I found some other places where version checks occur 1, 2, 3, 4, 5. Could you take a look and see if we can simplify/remove those?

Comment thread python/pyarrow/tests/test_extension_type.py Outdated

@ngoldbaum ngoldbaum 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.

I asked an AI model to review this with an eye toward code that can be deleted to simplify interfacing with Pandas and it found several more places where you can delete or simplify code. I'm happy to take on these cleanups in a followup if you think my suggestions are scope creep.

Comment thread python/pyarrow/tests/test_extension_type.py Outdated
Comment thread python/pyarrow/pandas-shim.pxi Outdated
Comment thread python/CMakeLists.txt
Comment thread python/pyarrow/pandas-shim.pxi Outdated
Comment thread python/pyarrow/pandas-shim.pxi Outdated
Comment thread python/pyarrow/pandas-shim.pxi Outdated
Comment thread python/pyarrow/pandas-shim.pxi Outdated
Comment thread python/pyarrow/pandas_compat.py Outdated
Comment thread python/pyarrow/pandas_compat.py
Comment thread python/pyarrow/pandas_compat.py Outdated
@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Aug 3, 2026
@alippai

alippai commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@ngoldbaum @rok thanks, I’ll address the pandas upgrade too. It was addressing the numpy upgrade only. I believe pandas improvements are in scope for this MR. Addressing upstream fixes and even onboarding the optimal/newer APIs allowed by the new version should land together.

@alippai
alippai requested review from ngoldbaum and rok August 3, 2026 23:54

@ngoldbaum ngoldbaum 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.

Just one last nit but this otherwise looks good to me!

Comment thread python/pyarrow/types.pxi Outdated
@alippai
alippai requested a review from raulcd August 4, 2026 23:44

@jorisvandenbossche jorisvandenbossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me!

Comment thread .github/workflows/python.yml
Comment thread dev/tasks/tasks.yml Outdated
@github-actions github-actions Bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Aug 6, 2026
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
@alippai

alippai commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@rok @raulcd @kou this is now ready again, two approvals added.

pandas also requires numpy 2.0 in the upcoming pandas 3.1: pandas-dev/pandas#63403 (comment)

@kou

kou commented Aug 13, 2026

Copy link
Copy Markdown
Member

I'll merge this in the next week if nobody objects it.

@raulcd

raulcd commented Aug 14, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g python -g wheel

@github-actions

Copy link
Copy Markdown

Revision: 55efae1

Submitted crossbow builds: ursacomputing/crossbow @ actions-1ef568d46d

Task Status
example-python-minimal-build-fedora-conda GitHub Actions
example-python-minimal-build-ubuntu-venv GitHub Actions
python-sdist GitHub Actions
test-conda-python-3.11 GitHub Actions
test-conda-python-3.11-dask-latest GitHub Actions
test-conda-python-3.11-dask-upstream_devel GitHub Actions
test-conda-python-3.11-hdfs-2.9.2 GitHub Actions
test-conda-python-3.11-hdfs-3.2.1 GitHub Actions
test-conda-python-3.11-hypothesis GitHub Actions
test-conda-python-3.11-pandas-2.2.2-numpy-2.0.2 GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
test-conda-python-3.12 GitHub Actions
test-conda-python-3.12-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.13 GitHub Actions
test-conda-python-3.13-pandas-latest-numpy-2.1.3 GitHub Actions
test-conda-python-3.13-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.14 GitHub Actions
test-conda-python-3.14-cpython-debug GitHub Actions
test-conda-python-3.14-pandas-nightly-numpy-nightly GitHub Actions
test-conda-python-3.14-pandas-upstream_devel-numpy-nightly GitHub Actions
test-conda-python-emscripten GitHub Actions
test-debian-13-python-3-amd64 GitHub Actions
test-debian-13-python-3-i386 GitHub Actions
test-fedora-42-python-3 GitHub Actions
test-ubuntu-24.04-python-3 GitHub Actions
wheel-macos-monterey-cp311-cp311-amd64 GitHub Actions
wheel-macos-monterey-cp311-cp311-arm64 GitHub Actions
wheel-macos-monterey-cp312-cp312-amd64 GitHub Actions
wheel-macos-monterey-cp312-cp312-arm64 GitHub Actions
wheel-macos-monterey-cp313-cp313-amd64 GitHub Actions
wheel-macos-monterey-cp313-cp313-arm64 GitHub Actions
wheel-macos-monterey-cp314-cp314-amd64 GitHub Actions
wheel-macos-monterey-cp314-cp314-arm64 GitHub Actions
wheel-macos-monterey-cp314-cp314t-amd64 GitHub Actions
wheel-macos-monterey-cp314-cp314t-arm64 GitHub Actions
wheel-manylinux-2-28-cp311-cp311-amd64 GitHub Actions
wheel-manylinux-2-28-cp311-cp311-arm64 GitHub Actions
wheel-manylinux-2-28-cp312-cp312-amd64 GitHub Actions
wheel-manylinux-2-28-cp312-cp312-arm64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313-amd64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313-arm64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314-arm64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-arm64 GitHub Actions
wheel-musllinux-1-2-cp311-cp311-amd64 GitHub Actions
wheel-musllinux-1-2-cp311-cp311-arm64 GitHub Actions
wheel-musllinux-1-2-cp312-cp312-amd64 GitHub Actions
wheel-musllinux-1-2-cp312-cp312-arm64 GitHub Actions
wheel-musllinux-1-2-cp313-cp313-amd64 GitHub Actions
wheel-musllinux-1-2-cp313-cp313-arm64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314-amd64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314-arm64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314t-amd64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314t-arm64 GitHub Actions
wheel-windows-cp311-cp311-amd64 GitHub Actions
wheel-windows-cp312-cp312-amd64 GitHub Actions
wheel-windows-cp313-cp313-amd64 GitHub Actions
wheel-windows-cp314-cp314-amd64 GitHub Actions
wheel-windows-cp314-cp314t-amd64 GitHub Actions

@raulcd raulcd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There seems to be a single test failure with upstream and nightly pandas but the rest LGTM. Thanks for the great job @alippai

@@ -430,16 +429,14 @@ def test_backwards_compatible_index_multi_level_some_named(datadir):

@pytest.mark.pandas
def test_backwards_compatible_column_metadata_handling(datadir):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The failures seem related to the changes on test_backwards_compatible_column_metadata_handling. They didn't fail for the last nightly run:
https://github.com/ursacomputing/crossbow/actions/runs/31758047403/job/94638094168
Last nightly for test-conda-python-3.14-pandas-upstream_devel-numpy-nightly used: numpy 2.6.0.dev0+git20260812.d712d42 and pandas 3.1.0.dev0+1566.gf040cfd389
on this job: numpy 2.6.0.dev0+git20260812.d712d42 and pandas 3.1.0.dev0+1567.g7b0bc4da28

So there's a single pandas commit difference which seems unrelated:
pandas-dev/pandas@7b0bc4d

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this is happening because of pandas-dev/pandas#65194. This test is skipped on main so this is the first time it's been hit. One way to paper over this is to pass check_freq=False to assert_frame_equal below.

@jorisvandenbossche should this maybe have been a warning instead of an error on the Pandas side?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For a normal (non-multi) index, pandas already raised before in assert_frame_equal (and so there the referenced PR is not changing anything), but for a MultiIndex I indeed see a change in behaviour, and ideally that should go through a deprecation warning as well.

But indeed, for here, passing check_freq=False should resolve it. Or alternatively add a ._with_freq(None) to the chain when creating the dates variable.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(reported as pandas-dev/pandas#66761)

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting merge Awaiting merge labels Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants