#35643 closed Bug (fixed)
Regression in Queryset sequence of value, annotate, order, value
Reported by: | Gert Van Gool | Owned by: | Simon Charette |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 5.1 |
Severity: | Release blocker | Keywords: | |
Cc: | Gert Van Gool | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Testing the 5.1RC on our project, I noticed a failure in a queryset that worked before (Django 5.0.7)
I've added a test case:
diff --git i/tests/queries/tests.py w/tests/queries/tests.py index 7ac8a65d42..c19d877ffc 100644 --- i/tests/queries/tests.py +++ w/tests/queries/tests.py @@ -1375,6 +1375,16 @@ class Queries1Tests(TestCase): self.assertCountEqual(items_after, [self.i2, self.i3, self.i4]) self.assertCountEqual(items_before, items_after) + def test_values_count_value(self): + self.assertSequenceEqual( + Tag.objects.all() + .values("category") + .annotate(Count("category")) + .order_by("-category__count") + .values_list("category", flat=True), + [self.nc1.id, None], + ) + class Queries2Tests(TestCase): @classmethod
Change History (5)
comment:1 by , 5 months ago
Owner: | set to |
---|---|
Severity: | Normal → Release blocker |
Status: | new → assigned |
Version 0, edited 5 months ago by (next)
comment:2 by , 5 months ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 5 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
Bisected to b0ad41198b3e333f57351e3fce5a1fb47f23f376.