#30771: Filtering on query result overrides GROUP BY of internal query
-------------------------------------+-------------------------------------
Reporter: Aur Saraf | Owner: James
| Timmins
Type: Bug | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: annotate, | Triage Stage:
annotation, filter, groupby, | Unreviewed
aggregate, aggregation |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
Thanks for tackling that one James!
If I can provide you some guidance I'd suggest you have a look at
`lookups.Exact.process_rhs`
https://github.com/django/django/blob/ea25bdc2b94466bb1563000bf81628dea4d80612/django/db/models/lookups.py#L265-L267
We probably don't want to perform the `clear_select_clause` and
`add_fields(['pk'])` when the query is already only selecting a single
field.
--
Ticket URL: <https://code.djangoproject.com/ticket/30771#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.e4196d95f4e0ca76fe55b9509a188b47%40djangoproject.com.