apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
14.14k stars 3.45k forks source link

[Python] Setup type checking with mypy #24376

Open asfimport opened 4 years ago

asfimport commented 4 years ago

Get mypy checks running, activate things like check_untyped_defs later.

Reporter: Uwe Korn / @xhochy

PRs and other links:

Note: This issue was originally created as ARROW-8175. Please see the migration documentation for further details.

asfimport commented 2 years ago

Todd Farmer / @toddfarmer: This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.

asfimport commented 1 year ago

Kyle Barron: Working with pyarrow in e.g. vscode is really painful at the moment because of the lack of user-facing types. vscode can access the top-level functions, but then as soon as you create a class, it becomes Any.


import pyarrow.parquet as pq
table = pq.read_table()
table # <-- Any
table. # <-- no auto completions

This may be a slightly different ask than the title of this ticket, as I'm referring to the developer experience while writing the code, not checking code. I can create a separate ticket if desired.

For now, I may create my own third-party type hints for this using mypy's stubgen

groceryheist commented 1 year ago

Note that this isn't specific to VSCode. For example, I got here after having this issue in emacs. The feature request is to provide a "stubs" package e.g., https://github.com/pandas-dev/pandas-stubs

ion-elgreco commented 11 months ago

Why doesn't pyarrow use any static type hints? This seems very strange.