#35235: ArrayAgg() doesn't return default when filter contains __in=[].
----------------------------------+--------------------------------------
Reporter: Per Carlsen | Owner: Sharon Woo
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 5.0
Severity: Normal | Resolution:
Keywords: ArrayAgg | Triage Stage: Accepted
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 taking a shot at fixing the issue Sharon and the mentoring
David.
Just dropping a message to say that I believe your solution in comment:5
and your assessment about similarity with #35149 is right David. I guess
an alternative could be to wrap the default in `ExpressionWrapper` instead
to avoid the `.output_field` assignment foot gun. Foot gun that we could
probably disarm by making `BaseExpression.output_field` a `@property` that
clears the `_output_field_or_none` cache on assignment as I wouldn't be
surprised other well intended `.output_field` assignments are not working
as expected.
We should definitely address this issue and I wonder if we should also
adjust the documentation to denote that the `Value` wrapping is not
necessary anymore (in other words `default=[]` should just work).
--
Ticket URL: <https://code.djangoproject.com/ticket/35235#comment:10>
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/0107018dcc0da3f4-a678e380-95f0-432c-b5c9-64f6fd613b50-000000%40eu-central-1.amazonses.com.