Open joao-parana opened 1 year ago
Seconding this. In my experience, mypy
is not able to type-check code that uses PyArrow, either.
Solution 1 : Install PyArrow type stubs You can try installing the PyArrow type stubs separately using the following command:
pip install pyarrow-stubs
This package contains the necessary type annotations for PyArrow, allowing Pyright to understand the library's API and perform accurate type checking.
Solution 2 : Use an alternative linter If installing the PyArrow type stubs doesn't resolve the issue, consider using a different linter that supports PyArrow or provides more flexible type checking. Mypy and PyLint are popular alternatives that you can install and configure to check your code.
Solution 3 : Ignore the Pyright error If you are confident in the correctness of your PyArrow usage and want to continue using Pyright without type checking for PyArrow, you can configure Pyright to ignore the specific error related to the missing stub file. Create a pyrightconfig.json file in your project's root directory and add the following content:
{
"reportMissingTypeStubs": "none"
}
This configuration will prevent Pyright from reporting the missing stub file error for "pyarrow".
Please note that the availability and compatibility of type stubs can vary across different libraries, and not all libraries may have dedicated stub files. If none of the above solutions work, consider reaching out to the PyArrow community or raising an issue on the Pyright GitHub repository for further assistance.
Duplicate of https://github.com/apache/arrow/issues/32609
Describe the usage question you have. Please include as many useful details as possible.
When I import PyArrow and use Pyright linter CLI, it reports: Stub file not found for "pyarrow"
show this:
By the way,
pyright
is a Type Checker for Python. See : `https://github.com/microsoft/pyrightAny suggestion to solve this?
Tanks.
Component(s)
Python