Skip to content

GH-49103: [Python][Annotations] Add internal type system stubs (_types, error, _stubs_typing)#48622

Open
rok wants to merge 21 commits into
apache:mainfrom
rok:pyarrow-stubs-pr2-core-types
Open

GH-49103: [Python][Annotations] Add internal type system stubs (_types, error, _stubs_typing)#48622
rok wants to merge 21 commits into
apache:mainfrom
rok:pyarrow-stubs-pr2-core-types

Conversation

@rok

@rok rok commented Dec 22, 2025

Copy link
Copy Markdown
Member

Rationale for this change

This is the second in series of PRs adding type annotations to pyarrow and resolving #32609. It builds on top of and should be merged after #48618.

What changes are included in this PR?

This adds:

  • _types.pyi - Core type definitions including
  • _stubs_typing.pyi - Internal typing protocols and helpers used across stub files
  • error.pyi - Exception classes (ArrowException, ArrowInvalid, ArrowIOError, etc.)
  • Minimal placeholder stubs - lib.pyi, io.pyi, scalar.pyi - using __getattr__ to allow imports to resolve while deferring to subsequent PRs

Are these changes tested?

Via CI type checks established in #48618.

Are there any user-facing changes?

Users will start seeing some minimal annotated types.

Comment thread python/pyarrow-stubs/pyarrow/_stubs_typing.pyi Outdated
@rok rok force-pushed the pyarrow-stubs-pr2-core-types branch from d3c5740 to 27d1c65 Compare January 26, 2026 12:57
@rok

rok commented Jan 26, 2026

Copy link
Copy Markdown
Member Author

I've rebased this on the annotation infra check PR (#48618) to make sure we're on the right track.

@rok rok force-pushed the pyarrow-stubs-pr2-core-types branch 2 times, most recently from 3f9ed3b to 0ac95b0 Compare January 26, 2026 19:11
@rok rok changed the title GH-32609: [Python] Add internal type system stubs (_types, error, _stubs_typing) GH-49103: [Python] Add internal type system stubs (_types, error, _stubs_typing) Jan 31, 2026
@github-actions

Copy link
Copy Markdown

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

@rok rok force-pushed the pyarrow-stubs-pr2-core-types branch 3 times, most recently from 7873930 to 43e7cc6 Compare February 9, 2026 19:11
@rok rok marked this pull request as ready for review February 9, 2026 20:09
@rok rok force-pushed the pyarrow-stubs-pr2-core-types branch from 51a7a4e to 7bc0a98 Compare February 13, 2026 15:24
@rok rok force-pushed the pyarrow-stubs-pr2-core-types branch 5 times, most recently from 0d15871 to 8f3796d Compare March 9, 2026 23:51
@rok rok requested a review from dangotbanned March 10, 2026 00:01
@rok rok force-pushed the pyarrow-stubs-pr2-core-types branch from 8f3796d to 72571d2 Compare March 10, 2026 13:39
Copilot AI review requested due to automatic review settings June 14, 2026 17:45
@rok rok force-pushed the pyarrow-stubs-pr2-core-types branch from 99f5809 to 8982d1e Compare June 14, 2026 17:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comment thread python/pyarrow/fs.py Outdated
Comment thread python/pyarrow-stubs/pyarrow/_types.pyi Outdated
Comment thread python/pyarrow-stubs/pyarrow/io.pyi
Comment thread python/pyarrow-stubs/pyarrow/scalar.pyi
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 14, 2026 19:15
@rok rok requested a review from dangotbanned June 14, 2026 19:15
@rok

rok commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

Finally took some time to work on this again. @dangotbanned I accepted you proposals and added some other changes. Could you please take another look and maybe we can merge?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread python/pyarrow-stubs/pyarrow/error.pyi
Comment thread python/pyarrow-stubs/pyarrow/_types.pyi
@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jun 14, 2026
@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python][Annotations] Add internal type system stubs (_types, error, _stubs_typing)

5 participants