#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 David Sanders):

 Replying to [comment:10 Simon Charette]:
 > 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

 Would there be any harm in simply removing `@cached_property` on
 `BaseExpression._output_field_or_none`? 🤔  It's body is simply:

     def _output_field_or_none(self):
             return self.output_field
         except FieldError:
             if not self._output_field_resolved_to_none:

 and `output_field` is already `@cached_property` as you mentioned, so it
 seems redundant. These 2 methods were both introduced as cached props when
 originally added by Josh in 2013. I just wonder whether Josh was being
 extra safe around the `FieldError` handling.
Ticket URL: <https://code.djangoproject.com/ticket/35235#comment:11>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to