-
-
Notifications
You must be signed in to change notification settings - Fork 145
Description
Describe the bug
mypy is unable to run with the following error when pandas-stubs is installed. The error is as following:
Traceback (most recent call last):
File "/code/.venv/bin/mypy", line 8, in
sys.exit(console_entry())
^^^^^^^^^^^^^^^
File "/code/.venv/lib/python3.11/site-packages/mypy/main.py", line 15, in console_entry
main()
File "mypy/main.py", line 102, in main
File "mypy/main.py", line 186, in run_build
File "mypy/build.py", line 194, in build
File "mypy/build.py", line 269, in _build
File "mypy/build.py", line 2935, in dispatch
File "mypy/build.py", line 3333, in process_graph
File "mypy/build.py", line 3460, in process_stale_scc
File "mypy/build.py", line 2497, in write_cache
File "mypy/build.py", line 1559, in write_cache
File "mypy/nodes.py", line 390, in serialize
File "mypy/nodes.py", line 4010, in serialize
File "mypy/nodes.py", line 3947, in serialize
File "mypy/nodes.py", line 3371, in serialize
File "mypy/types.py", line 682, in serialize
File "mypy/types.py", line 2475, in serialize
File "mypy/types.py", line 1498, in serialize
File "mypy/types.py", line 682, in serialize
File "mypy/types.py", line 3160, in serialize
AssertionError: Internal error: unresolved placeholder type None
When pandas-stubs is uninstalled, the following result will be seen:
Success: no issues found in 1 source file
When a different command is ran with pandas-stubs installed, the following result will be seen:
Success: no issues found in 1 source file
To Reproduce
- pip install pandas-stubs & mypy in a python3.11 virtual environment
- run command
mypy -c 'import pandas as pd'
- this will fail - run command
mypy -c 'import os'
- this will pass
Please complete the following information:
- OS: Linux (Windows WSL2)
- OS Version - Ubuntu 22.04.2 LTS
- python version 3.11.10
- version of type checker - mypy: 1.13.0 & mypy-extensions: 1.0.0
- version of installed
pandas-stubs
- pandas-stubs-2.2.3.241009
Additional context
pre-commit is working but likely it is due to not having pandas-stubs installed.
Likely not a pandas-stubs issue, but just want to point out that it is also frustrating that the above error did not proper tracebacks to know that pandas-stubs was the library that caused it - I had trial and error with many individual scripts to reproduce it efficiently.