#36693: The "default" argument for ArrayAgg is being ignored
-------------------------------------+-------------------------------------
Reporter: Bryant Glisson | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: annotation, array | Triage Stage:
aggregation | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
ontowee's assessment is on point.
You haven't provided your model definition so it's hard to tell for sure
but all signs point at your aggregate function targeting a multi-valued
nullable relationship (`sites`) which means that it will include `NULL`
when there are no matches.
If you want to exclude them from the targeted set you should pass
`filter=~Q(sites=None)` to your `ArrayAgg` which will default to `NULL` on
an empty set and use the provided `default`.
--
Ticket URL: <https://code.djangoproject.com/ticket/36693#comment:2>
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/0107019a2cf88c12-5ca4b34f-6da3-4096-8939-5746a1f5f656-000000%40eu-central-1.amazonses.com.