#36388: QuerySet.union no longer supports empty args
--------------------------------+--------------------------------------
Reporter: Antoine Humeau | Owner: (none)
Type: Bug | Status: new
Component: Uncategorized | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Sarah Boyce):
* cc: Simon Charette (added)
Comment:
git bisect to 9cb8baa0c4fa2c10789c5c8b65f4465932d4d172
Possible regression test
{{{#!diff
diff --git a/tests/queries/test_qs_combinators.py
b/tests/queries/test_qs_combinators.py
index ba44b5ed87..d262e2f612 100644
--- a/tests/queries/test_qs_combinators.py
+++ b/tests/queries/test_qs_combinators.py
@@ -88,6 +88,10 @@ class QuerySetSetOperationTests(TestCase):
qs3 = qs1.union(qs2)
self.assertNumbersEqual(qs3[:1], [0])
+ def test_empty_union_slice(self):
+ qs = Number.objects.union()
+ self.assertNumbersEqual(qs[:1], [0])
+
def test_union_all_none_slice(self):
qs = Number.objects.filter(id__in=[])
with self.assertNumQueries(0):
}}}
However, I agree that this usage isn't supported. Perhaps a breaking
change note is enough here? We might want a nicer error also
--
Ticket URL: <https://code.djangoproject.com/ticket/36388#comment:1>
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 visit
https://groups.google.com/d/msgid/django-updates/01070196c9f23144-1dcb1c08-c3ac-4c97-a512-7e87a72c9961-000000%40eu-central-1.amazonses.com.