A new home for pyarrow-stubs? #45919
Replies: 5 comments 52 replies
-
|
Thank you for opening up this discussion! There is a general consensus on the need for type annotations in PyArrow. In my opinion, the main challenge to progress is the lack of agreement on the approach to take. To add some context, here are a few key comments from the ongoing discussion in #32609:
|
Beta Was this translation helpful? Give feedback.
-
|
Just wanted to keep this discussion active—following up with my thoughts on a possible path forward. I believe a good approach would be to coordinate efforts with the That said, PyArrow developers are currently managing several priorities, so this likely isn’t something we can kick off immediately. Still, it would be valuable to start planning how we want to approach this. Based on the ongoing discussions, I’d like to highlight a couple of key points:
Lastly, I was recently pointed to a new type checker tool: https://github.com/astral-sh/ty. Does anyone have experience with it? |
Beta Was this translation helpful? Give feedback.
-
|
As a sprint at EuroPython @paddyroddy and I created a draft for including @zen-xu's pyarrow-stubs with pyarrow (as proposal nr 2 in #32609 (comment)). We used If we decide to proceed with this we would of course need @zen-xu donating pyarrow-stubs first. Things that come to mind after working on this:
|
Beta Was this translation helpful? Give feedback.
-
|
Another update. Following received feedback I've created a second draft. This one takes the approach of adding pyarrow-stubs, then checks annotations on a single test file (test_compute.py) using The idea would be that CI would report stub check failures and we can enforce annotations remain in sync. Type coverage metric, stub linter and pre-commit hook were some ideas suggested so far that can come later. I would propose we inline annotations where possible - @mpelko did a proof of concept here. If there are no significant objections I'll open a PR against the main repo and start a ML discussion. |
Beta Was this translation helpful? Give feedback.
-
Easing maintenance burdenNote TL;DR: If downstream users feel confident they can contribute typing-only changes, they'll be able to spread the burden 🙂 How the stubs/inline typing can be maintained in a sustainable way, seems to have been a concern of most voices here: Show related comments
While there is Writing and Maintaining Stub Files to refer to for guidance, both that document and (I assume) the discussion so far have been asking/answering:
That is an important question, but I think making the process sustainable may benefit from answering this question as well:
I can only speak to my own experience, so as an example ... Example storyI feel confident in identifying when there are issues in stubs, even if that requires reading a lil bit of I feel less confident that I'd pull off following docs/developers/python without issue - as someone with less experience on projects with a compile-step. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
The maintainer of pyarrow-stubs (a set of Python type stubs for arrow) has expressed interest in donating the stubs since they no longer have time to maintain them: zen-xu/pyarrow-stubs#186
I'm opening a discussion here to see if there's any interest in merging the stubs into the main arrow project. They may remain as stubs, or if there is interest, they can also be merged into the Python bindings as inline types.
I'm happy to help set up the appropriate CI to support future maintenance and make sure the types are accurate/up-to-date going forward.
I see an existing issue for this topic (#30426), but not a lot of active discussion, so I'm hoping to hear what the maintainers think.
Beta Was this translation helpful? Give feedback.
All reactions