-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
.annotate(...) does not seem to work with reverse-related foreign key lookupu #2382
Comments
ah I see from reading the code that it just doesn't support non-named arguments. there's a few tests which are passing just due to luck it seems (since they also use non-named arguments assuming they'll produce a what's a little weird is this seems to have worked before django-stubs 5.1.0 -- but I suspect that was due to the old implementation being buggy |
actually just one test:
|
Yes, the most recent implementation is less forgiving for django-stubs/mypy_django_plugin/transformers/querysets.py Lines 246 to 275 in ffcebb3
Since the alias resolution logic is fairly non-trivial, we have several options here:
The last options appears to be most promising: it also enables an extra safety check (detect a runtime error if a more complex aggregate is passed as a positional arg to |
Bug report
wrote a little testcase -- will see if I can figure out a quick fix for it
What's wrong
How is that should be
should resolve correctly
System information
python
version: 3.12.6django
version: 5.1.1mypy
version: 1.11.django-stubs
version: 5.1.0django-stubs-ext
version: 5.1.0The text was updated successfully, but these errors were encountered: