Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3dbb498
Add type stubs for the compute and Acero modules
rok Nov 13, 2026
79fc644
Review changes of _acero.pyi
AlenkaF Nov 17, 2026
9884c5c
Review changes of _compute.pyi
AlenkaF Nov 17, 2026
93441bd
Order compute.pyi to match C++ docs
AlenkaF Nov 18, 2026
aa7a551
Remove ArrayLike import and define _ArrayLike
AlenkaF Nov 19, 2026
3bf0530
Reorder stubs to match _compute.pyx and C++ api order (not only secti…
AlenkaF Nov 19, 2026
b70f4e5
Update count function, add and reorganize tests
AlenkaF Nov 19, 2026
c70bbdb
Use general Scalar in parameters, no narrow types
AlenkaF Nov 19, 2026
a530395
Review the rest of the aggregations section in compute.pyi
AlenkaF Nov 20, 2026
1437722
Review Arithmetic Arithmetic functions stubs
AlenkaF Nov 20, 2026
765a1bc
Review rounding, log and trig stubs, list ChunkedArray in signatures,…
AlenkaF Nov 20, 2026
b40ed25
Update _ArrayLike type alias
AlenkaF Nov 20, 2026
4394741
Replace ScalarLike, review comparison, logical and string stubs
AlenkaF Nov 21, 2026
1b56756
Review containment tests functions
AlenkaF Nov 23, 2026
eca0aa9
Remove Expression from aggregation and meta function stubs
AlenkaF Nov 23, 2026
96a8f4c
Review element-wise functions: categorization, selection, transforms …
AlenkaF Nov 23, 2026
f9eefdb
Review temporal functions stubs
AlenkaF Nov 23, 2026
8a4eac4
Review the rest of compute.pyi
AlenkaF Nov 24, 2026
a77423f
Fix segfault in partition_nth_indices
AlenkaF Nov 25, 2026
7a4ebfb
Update comment for partition_nth_indices test
AlenkaF Nov 25, 2026
12b1440
Remove _compute_docstrings.pyi
AlenkaF Nov 25, 2026
f4c18d5
Copilot review - register_* methods and in_types stubs
AlenkaF Nov 27, 2026
0a7f2ce
Copilot review: register_tabular_function and extract_regex
AlenkaF Nov 27, 2026
e5001d1
Copilot review - make_struct update
AlenkaF Nov 27, 2026
ff99bed
Copilot review - subsecond update
AlenkaF Nov 27, 2026
dea6869
Copilot review - list_contains update
AlenkaF Nov 27, 2026
d4813f9
Copilot review - list_slice update
AlenkaF Nov 27, 2026
38fb88a
Remove scalar placeholders in compute.pyi
AlenkaF Dec 2, 2026
30064ca
Define shared NumericLiteral and TemporalLiteral
AlenkaF Dec 2, 2026
d609f7f
Widen 7 compute stubs to use _Literal type alias
AlenkaF Dec 2, 2026
0cbcd7d
Rename variables in the tests
AlenkaF Dec 2, 2026
37ee98f
Clear TODOs in tests
AlenkaF Dec 2, 2026
04add2c
Add missing assert_type checks in test_compute
AlenkaF Dec 2, 2026
b4d5792
Update scalar import in _compute.pyi also
AlenkaF Dec 2, 2026
0394026
Resolve TODO(GH-29828)
AlenkaF Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ repos:
# pre-commit run --hook-stage manual python-stubs --all-files
# The type checkers run with uvx, in the environment of
# python/requirements-stubs.txt. They don't need PyArrow installed: the
# modules that aren't annotated yet, e.g. pyarrow.compute, are treated as Any
# (see python/pyproject.toml).
# modules that aren't annotated yet, e.g. pyarrow.interchange, are treated
# as Any (see python/pyproject.toml).
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.2
hooks:
Expand Down
1 change: 1 addition & 0 deletions python/pyarrow-stubs-tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ pyarrow\.__lib\.[a-z]+\.__all__

# The __init__ of Cython extension types takes (*args, **kwargs) at runtime.
pyarrow\.__lib\.[a-z]+\.[A-Za-z_]+\.__init__
pyarrow\._compute\.(Expression|Function|FunctionRegistry|Kernel|UdfContext)\.__init__
51 changes: 51 additions & 0 deletions python/pyarrow-stubs-tests/test_acero.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

from typing import TYPE_CHECKING

import pytest

import pyarrow as pa

from _check import assert_type, check

# PyArrow can be built without Acero.
pytest.importorskip("pyarrow._acero")
Comment on lines +26 to +27

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👨 Are we going to test without acero?


from pyarrow._acero import ( # noqa: E402
AggregateNodeOptions,
Declaration,
TableSourceNodeOptions,
)


def test_declaration() -> None:
table = pa.table({"a": [1, 2]})
decl = Declaration("table_source", TableSourceNodeOptions(table))
check(assert_type(decl, Declaration), Declaration)
check(assert_type(decl.to_table(), pa.Table), pa.Table)

if TYPE_CHECKING:
TableSourceNodeOptions(table.to_batches()[0]) # type: ignore[arg-type]


def test_aggregate() -> None:
aggr_opts = AggregateNodeOptions([(["a"], "sum", None, "a_sum")])
check(assert_type(aggr_opts, AggregateNodeOptions), AggregateNodeOptions)

aggr_opts = AggregateNodeOptions([(("a", ), "sum", None, "a_sum")])
check(assert_type(aggr_opts, AggregateNodeOptions), AggregateNodeOptions)
Loading
Loading