Repository navigation
Conversation
|
|
rok
commented
Feb 9, 2026
rok
added a commit
to rok/arrow
that referenced
this pull request
Nov 13, 2026
Add type annotation stubs for compute, _compute, _compute_docstring, and _acero modules. These are the stubs of apacheGH-49201 as they were, at their original paths. The type checker accommodations that apacheGH-49201 made in compute.py, acero.py and the PyArrow tests are left out, as the type checkers no longer run on pyarrow/ (see apacheGH-55264).
rok
added a commit
to rok/arrow
that referenced
this pull request
Nov 13, 2026
Add type annotation stubs for compute, _compute, _compute_docstring, and _acero modules. These are the stubs of apacheGH-49201 as they were, at their original paths. The type checker accommodations that apacheGH-49201 made in compute.py, acero.py and the PyArrow tests are left out, as the type checkers no longer run on pyarrow/ (see apacheGH-55264).
rok
added a commit
to rok/arrow
that referenced
this pull request
Nov 13, 2026
Add type annotation stubs for compute, _compute, _compute_docstring, and _acero modules. These are the stubs of apacheGH-49201 as they were, at their original paths. The type checker accommodations that apacheGH-49201 made in compute.py, acero.py and the PyArrow tests are left out, as the type checkers no longer run on pyarrow/ (see apacheGH-55264).
rok
force-pushed
the
pyarrow-stubs-pr4-compute
branch
from
November 13, 2026 13:06
d3f0fb7 to
a78bedf
Compare
rok
force-pushed
the
pyarrow-stubs-pr4-compute
branch
2 times, most recently
from
November 13, 2026 13:29
29a6b0b to
fb3204a
Compare
Member
Author
|
Given there were changes in the data types PR you might want to rebase or merge them here @AlenkaF. |
AlenkaF
force-pushed
the
pyarrow-stubs-pr4-compute
branch
from
November 18, 2026 05:21
e8779e3 to
300602b
Compare
Member
|
Oh, should have squashed, sorry. |
AlenkaF
reviewed
Nov 18, 2026
AlenkaF
reviewed
Nov 18, 2026
4 of 5 tasks
AlenkaF
reviewed
Nov 18, 2026
AlenkaF
reviewed
Nov 18, 2026
Annotate pyarrow.compute, pyarrow._compute, pyarrow._acero and pyarrow._compute_docstrings, following the approach of apacheGH-55264: plain classes and unions instead of generics, in the flat pyarrow-stubs/ layout. - Array arguments accept any Array or ChunkedArray, since pa.array() and most of the API return plain Array instances. The return types name the kind of array where the function determines it. The scalar classes are placeholders (Any) until scalar.pyi is annotated. - The signatures match the runtime, as checked by stubtest. - pyarrow.compute and pyarrow._compute are type checked instead of being treated as Any. - Add type annotation tests for the compute and Acero stubs.
AlenkaF
force-pushed
the
pyarrow-stubs-pr4-compute
branch
from
November 19, 2026 09:19
300602b to
bc6a844
Compare
…ons but also individual functions)
AlenkaF
reviewed
Nov 19, 2026
| check(assert_type(field.equals(pc.field("a")), bool), bool) | ||
|
|
||
| # Calling a compute function with an expression builds an expression. | ||
| check(pc.count(field), pc.Expression) |
Member
There was a problem hiding this comment.
Note to myself: add assert_type checks once the scalar stubs land.
AlenkaF
reviewed
Nov 19, 2026
|
|
||
| # =============================== Aggregations ======================================== | ||
| def all( | ||
| array: BooleanScalar | _ArrayOrChunkedArray | Expression, |
Member
There was a problem hiding this comment.
To be consistent with decisions made in array.pyi we should use general Scalar class in parameters, not narrow types like BooleanScalar and aliases like _NumericScalar. The narrow types stay for returns.
… clean up the tests
This was referenced Nov 24, 2026
Member
|
This PR should be ready with only one TODO after #55592 is merged:. See #49201 (comment). @rok @tadeja I can rebase after #55264 is merged so the review from your side will be easier. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Closes: #49194
What changes are included in this PR?
Adds type annotation stubs for compute, _compute, _compute_docstring, and _acero modules. Includes source fixes in compute.py and acero.py, and type-ignore annotations in related tests.
Are these changes tested?
Yes, by CI.
Are there any user-facing changes?
Compute module functions will be type annotated.