-
-
Notifications
You must be signed in to change notification settings - Fork 483
Plugin regression with mypy 0.99x: FieldDoesNotExist #1261
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
Comments
Please let me know if this issue affects any real codebase as well. Currently it has only been observed in our CI. Possible work-around: downgrade to mypy 0.982. |
From my digging:
class RenamedField(models.Model):
modelname = models.IntegerField(name="fieldname", choices=((1, 'One'),)) It should be noted that I'm only guessing, but perhaps it could be useful to avoid shadowing? e.g. class X(models.Model):
_type = models.IntegerField(name="type") In any case, the plugin doesn't support the django-stubs/mypy_django_plugin/transformers/fields.py Lines 34 to 42 in 7d50e5b
|
I'm suspecting that should be good enough until there would be any support for if field_name is None:
return None a couple of lines before. As such, |
See my fix in #1329 |
mypy_django_plugin
causes a mypy internal error when runningtypecheck_tests.py
on Django 3.2 source with mypy 0.991. Does not occur with Django 4.0.See
typecheck
failures in PR #1260.I have not yet had the time to investigate this. Any help would be welcome.
The text was updated successfully, but these errors were encountered: