You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that, in general, pyarrow does not support type hints. However, I think it is still sensible to add a py.typed marker file to the library. Let me demonstrate why,
$mypytest.pytest.py:1: error: Skippinganalyzing "pyarrow": module is installed, but missing library stubs or py.typed markertest.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-importstest.py:5: note: Revealed type is "Any"
Found 1 error in 1 file (checked 1 source file)
Note that mypy identifies table as being an Any type, when obviously it is a {}Table{}. If we include a py.typed file, mypy will be able to make these trivial inferences. The motivating example is this,
and mypy complains that overload 2 is covered entirely by overload 1.
I tried to test what adding a py.typed file would do, but I ran into compilation issues. I was hoping someone with a little more experience here could quickly test this out for me :)
Matteo Santamaria: @AlenkaF the proposed changes are so minimal that it might be easiest just to describe them, although I am happy to open a branch if that would help.
Basically, we just need to add an (empty) file called py.typed in arrow/python/pyarrow and then make sure it gets included in the distribution. PEP-561 suggests this might be as easy as adding it to the package data here.
Activity
asfimport commentedon Sep 30, 2022
Alenka Frim / @AlenkaF:
Hi
[~matteosantama], thank you for opening up this issue!Do you have a branch open that I could run locally?
asfimport commentedon Sep 30, 2022
Matteo Santamaria:
@AlenkaF the proposed changes are so minimal that it might be easiest just to describe them, although I am happy to open a branch if that would help.
Basically, we just need to add an (empty) file called
py.typedinarrow/python/pyarrowand then make sure it gets included in the distribution. PEP-561 suggests this might be as easy as adding it to the package data here.asfimport commentedon Oct 3, 2022
Alenka Frim / @AlenkaF:
I think Will gave a great answer on GitHub issues: #14291,
-DARROW_INSTALL_NAME_RPATH=OFFis what came to my mind also.