-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
Regression: related fields raise [attr-defined] #1872
Comments
Works around regression in latest release. See: typeddjango/django-stubs#1872
@WhyNotHugo I think I found the issue. It's a bit of a hidden one, this: #1802 I found the following If you apply the patch in #1802 (comment) ( Although there's still improvements we want from this report. The not so obvious issue is that our plugin processing of the model bails hard and almost invisibly on 1 of the model attributes, which skips any remaining correct or incorrect ones. We should be a bit more graceful and attempt to process all attributes individually and bail if we encountered any we couldn't resolve appropriately. That would also have been a resolution to this issue, essentially some form of "decoupling" within |
I think it is safe to close this issue in favour of the ones that you've mentioned. Thanks for bisecting this and thanks for the detailed explanation on the issue. |
Bug report
With
django-stubs==4.2.7
, reports[attr-defined]
for related fields of models. This works fine withdjango-stubs==4.2.6
.What's wrong
Related fields are reported as undefined.
How is that should be
Related fields should raise no error.
System information
python
version: 3.10 or 3.11django
version: 4.2.8mypy
version:mypy 1.6.1 (compiled: no)
django-stubs
version: 4.2.7django-stubs-ext
version: 4.2.7Reproduction scenario
This can easiest be reproduced with this repository:
Currently,
main
is3fcc7d4e3d3d0b8b201f9bc7ab35f52c003a852c
. Relevant dependencies can be installed withpip install -e '.[dev]'
.As can be seen, this was not a problem with 4.2.6.
The text was updated successfully, but these errors were encountered: