Repository navigation
Conversation
|
|
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).
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).
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).
d3f0fb7 to
a78bedf
Compare
29a6b0b to
fb3204a
Compare
|
Given there were changes in the data types PR you might want to rebase or merge them here @AlenkaF. |
e8779e3 to
300602b
Compare
|
Oh, should have squashed, sorry. |
300602b to
bc6a844
Compare
| 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) |
There was a problem hiding this comment.
Note to myself: add assert_type checks once the scalar stubs land.
|
|
||
| # =============================== Aggregations ======================================== | ||
| def all( | ||
| array: BooleanScalar | _ArrayOrChunkedArray | Expression, |
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.
4f879f7 to
96e582a
Compare
|
Before merging two todos ( |
| _UnsignedIntegerScalar: TypeAlias = ( | ||
| UInt8Scalar | UInt16Scalar | UInt32Scalar | UInt64Scalar | ||
| ) | ||
| _IntegerScalar: TypeAlias = _SignedIntegerScalar | _UnsignedIntegerScalar |
There was a problem hiding this comment.
There are quite some TypeAliases shared between different stub files that could be moved into a shared _stubs_typing.pyi. The diff will not be minimal so I will open a separate PR for that after this one is merged.
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.