Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization crash on pandera with pandas-stubs #18582

Closed
sterliakov opened this issue Feb 1, 2025 · 1 comment · Fixed by #18585
Closed

Serialization crash on pandera with pandas-stubs #18582

sterliakov opened this issue Feb 1, 2025 · 1 comment · Fixed by #18585
Labels

Comments

@sterliakov
Copy link
Collaborator

Crash Report

Running mypy on pandera with pandas-stubs installed results in a crash.

Traceback

pandera/api/function_dispatch.py:12: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Traceback (most recent call last):
  File "/tmp/tmp.KoqC85pWUZ/pandera/.venv/bin/mypy", line 10, in <module>
    sys.exit(console_entry())
             ^^^^^^^^^^^^^^^
  File "/tmp/tmp.KoqC85pWUZ/pandera/.venv/lib/python3.12/site-packages/mypy/__main__.py", line 15, in console_entry
    main()
  File "mypy/main.py", line 109, in main
  File "mypy/main.py", line 193, in run_build
  File "mypy/build.py", line 194, in build
  File "mypy/build.py", line 269, in _build
  File "mypy/build.py", line 2940, in dispatch
  File "mypy/build.py", line 3338, in process_graph
  File "mypy/build.py", line 3465, in process_stale_scc
  File "mypy/build.py", line 2502, in write_cache
  File "mypy/build.py", line 1562, in write_cache
  File "mypy/nodes.py", line 390, in serialize
  File "mypy/nodes.py", line 4049, in serialize
  File "mypy/nodes.py", line 3986, in serialize
  File "mypy/nodes.py", line 3408, in serialize
  File "mypy/types.py", line 678, in serialize
  File "mypy/types.py", line 2467, in serialize
  File "mypy/types.py", line 1495, in serialize
  File "mypy/types.py", line 678, in serialize
  File "mypy/types.py", line 3173, in serialize
AssertionError: Internal error: unresolved placeholder type None

To Reproduce

I'll try to narrow this down later, but now a repro script:

cd $(mktemp -d)
git clone https://github.com/pandera-dev/pandera
cd pandera
git checkout 33fe68b7d0c7c3a760469b9898acf286334fe34f  # Head as of now
python -m venv .venv
. ./.venv/bin/activate
pip install . 'mypy==1.14.1' 'pandas-stubs==2.2.3.241126'
hash -r
mypy pandera --show-traceback

Your Environment

  • Mypy version used: 1.14.1 and current master
  • Mypy command-line flags: n/a
  • Mypy configuration options from mypy.ini (and other config files): as specified in pandera's setup.cfg
  • Python version used: 3.12 and 3.13 tested
  • Operating system and version: Ubuntu 22.04.5 LTS (Linux pc 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux)
@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Feb 1, 2025

Likely related to #17396 (comment)
I had a hacky fix for it, but regressed type checking in some normal cases. If you see a better fix that would be cool!

wesleywright pushed a commit that referenced this issue Feb 4, 2025
…8585)

Fixes #18582. Fixes #17396. Supersedes #18351.

---------

Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
wesleywright pushed a commit that referenced this issue Feb 4, 2025
…8585)

Fixes #18582. Fixes #17396. Supersedes #18351.

---------

Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants