Repository navigation
Conversation
|
|
Member
|
Note: Moved also Future note: python/pyarrow-stubs/pyarrow/lib.pyi will need these two added as well: from pyarrow.__lib.compat import * # noqa: F401,F403
from pyarrow.__lib.pandas_shim import * # noqa: F401,F403 |
Replace the scalar.pyi placeholder with annotations for Scalar, its subclasses, NA and pyarrow.scalar(), following the conventions of the other stubs: plain classes instead of generics, the class hierarchy of the runtime (e.g. StringScalar is a BinaryScalar, the extension scalars are ExtensionScalars, ListScalar is a Sequence and StructScalar a Mapping), and concrete return types for as_py() and the value properties. Array and ChunkedArray now return real Scalar types from indexing, iteration, sum() and index(), so a ChunkedArray is no longer accepted as the mask of pyarrow.array(). Their __getitem__ gets two overloads, so that an index returns a Scalar and a slice an array, instead of a union of both. Add annotation tests for the scalars.
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.
…ons but also individual functions)
… clean up the tests
rok
force-pushed
the
pyarrow-stubs-pr8-leaf-modules
branch
2 times, most recently
from
November 30, 2026 18:04
14b3810 to
afdeb4a
Compare
…d serialization formats
…, interchange, and other modules
rok
force-pushed
the
pyarrow-stubs-pr8-leaf-modules
branch
from
November 30, 2026 18:14
afdeb4a to
a31718e
Compare
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: #49198
What changes are included in this PR?
Add type annotation stubs for flight, cuda, interchange, gandiva, substrait, pandas_compat, pandas_shim, cffi, compat, and util modules. Includes source fixes and type-ignore annotations in related tests.
Are these changes tested?
Yes, by CI.
Are there any user-facing changes?
Above mentioned ,modules will now be annotated.