Skip to content

mypy --show-traceback --show-error-codes src/ tests/ failing #19004

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

Closed
anshbansal opened this issue Apr 30, 2025 · 2 comments
Closed

mypy --show-traceback --show-error-codes src/ tests/ failing #19004

anshbansal opened this issue Apr 30, 2025 · 2 comments
Labels
bug mypy got something wrong

Comments

@anshbansal
Copy link

Bug Report

https://github.com/datahub-project/datahub/actions/runs/14757347168/job/41428929690?pr=13374

Traceback (most recent call last):
  File "mypy/semanal.py", line 7286, in accept
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at [https://github.com/python/mypy/issues](https://github.com/python/mypy/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)
version: 1.14.1
/home/runner/work/datahub/datahub/metadata-ingestion-modules/airflow-plugin/venv/lib/python3.10/site-packages/pydantic/env_settings.py:23: : note: use --pdb to drop into pdb
  File "mypy/nodes.py", line 1196, in accept
  File "mypy/semanal.py", line 1787, in visit_class_def
  File "mypy/semanal.py", line 2003, in analyze_class
  File "mypy/semanal.py", line 2050, in analyze_class_body_common
  File "mypy/semanal.py", line 2135, in apply_class_plugin_hooks
  File "pydantic/mypy.py", line 154, in pydantic.mypy.PydanticPlugin._pydantic_model_class_maker_callback
  File "pydantic/mypy.py", line 317, in pydantic.mypy.PydanticModelTransformer.transform
  File "pydantic/mypy.py", line 497, in pydantic.mypy.PydanticModelTransformer.add_construct_method
  File "mypy/types.py", line 614, in __init__
TypeError: mypy.types.TypeVarId object expected; got int

In this datahub-project/datahub#13374
Got this error https://github.com/datahub-project/datahub/actions/runs/14757347168/job/41428929690?pr=13374

Expected Behavior

Actual Behavior

Your Environment

  • Mypy version used: 1.14.1
  • Mypy command-line flags: mypy --show-traceback --show-error-codes src/ tests/
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.10.x
@anshbansal anshbansal added the bug mypy got something wrong label Apr 30, 2025
@sterliakov
Copy link
Collaborator

This error comes from pydantic plugin, not from mypy itself - most likely a compatibility problem. You're certainly missing relevant part of mypy.ini or pyproject.toml where the plugin is enabled. Are you using the latest pydantic version? Does this happen with latest and master mypy?

@brianschubert
Copy link
Collaborator

Duplicate of #17671 / pydantic/pydantic#10129. This should be fixed in pydantic 1.10.16+. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants