Skip to content

GH-53954: [Python] Declare NumPy runtime dependency - #53971

Closed
1932819331hy-debug wants to merge 1 commit into
apache:mainfrom
1932819331hy-debug:fix-numpy-runtime-dependency
Closed

1932819331hy-debug wants to merge 1 commit into
apache:mainfrom
1932819331hy-debug:fix-numpy-runtime-dependency

Conversation

@1932819331hy-debug

@1932819331hy-debug 1932819331hy-debug commented Oct 16, 2026 •

Copy link
Copy Markdown

Rationale for this change

PyArrow's Python extension requires NumPy 2.0 or newer, but that requirement is currently only declared in the build environment. A user can therefore install the package alongside NumPy 1.x and encounter an import-time failure.

What changes are included in this PR?

Adds dependencies = ["numpy>=2.0"] to the Python project metadata so package installers resolve the required NumPy runtime version.

Are these changes tested?

Not run locally. This metadata-only change should be verified by the project's packaging and CI checks.

Are there any user-facing changes?

Yes. Installing PyArrow from package metadata will require NumPy 2.0 or newer, matching the extension's runtime requirement.

Was AI used for this PR?

PR code and description written by: AI

Reviewed before submission by: AI

PyArrow's build requires NumPy >=2.0, and the extension rejects NumPy 1.x at import time. Declare the same minimum as a project dependency so installers resolve a compatible runtime version.
@github-actions

Copy link
Copy Markdown

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

Comment thread python/pyproject.toml
name = "pyarrow"
dynamic = ["version"]
requires-python = ">=3.11"
dependencies = ["numpy>=2.0"]

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.

Numpy is not a required runtime dependency of the project.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for clarifying. I understand that NumPy must remain optional, so declaring it in [project].dependencies is not the right fix. The reported failure is triggered when NumPy 1.x is installed; could you point me to the intended resolution for that case? I’ll adjust the PR accordingly.

@jorisvandenbossche

Copy link
Copy Markdown
Member

Fully automated PRs are not welcome, see https://arrow.apache.org/docs/developers/overview.html#ai-generated-code

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.

3 participants