You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "joao-parana (via GitHub)" <gi...@apache.org> on 2023/06/15 19:46:23 UTC

[GitHub] [arrow] joao-parana opened a new issue, #36113: When I import PyArrow and use Pyright linter CLI, it reports: Stub file not found for "pyarrow"

joao-parana opened a new issue, #36113:
URL: https://github.com/apache/arrow/issues/36113

   ### 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"
   
   ```python
   from pyarrow import parquet as pq
   # . . .
   # some python code here
   ```
   
   ```bash
   pyright main.py
   ```
   
   **show this:**
   
   ```txt
   Stub file not found for "pyarrow" (reportMissingTypeStubs)
   ```
   
   By the way, `pyright` is a Type Checker for Python. See : `https://github.com/microsoft/pyright
   
   Any suggestion to solve this?
   
   Tanks.
   
   ### Component(s)
   
   Python


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] SChakravorti21 commented on issue #36113: When I import PyArrow and use Pyright linter CLI, it reports: Stub file not found for "pyarrow"

Posted by "SChakravorti21 (via GitHub)" <gi...@apache.org>.
SChakravorti21 commented on issue #36113:
URL: https://github.com/apache/arrow/issues/36113#issuecomment-1593786520

   Seconding this. In my experience, [`mypy`](https://mypy-lang.org/) is not able to type-check code that uses PyArrow, either.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] rmorshea commented on issue #36113: [Python] When I import PyArrow and use Pyright linter CLI, it reports: Stub file not found for "pyarrow"

Posted by "rmorshea (via GitHub)" <gi...@apache.org>.
rmorshea commented on issue #36113:
URL: https://github.com/apache/arrow/issues/36113#issuecomment-1661533374

   Duplicate of https://github.com/apache/arrow/issues/32609


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] gowtham-source commented on issue #36113: [Python] When I import PyArrow and use Pyright linter CLI, it reports: Stub file not found for "pyarrow"

Posted by "gowtham-source (via GitHub)" <gi...@apache.org>.
gowtham-source commented on issue #36113:
URL: https://github.com/apache/arrow/issues/36113#issuecomment-1629281352

   **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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org