#34016: QuerySet.values_list() crash on simple ArrayAgg.
----------------------------------+------------------------------------
     Reporter:  Alex Kerkum       |                    Owner:  (none)
         Type:  Bug               |                   Status:  new
    Component:  contrib.postgres  |                  Version:  4.1
     Severity:  Release blocker   |               Resolution:
     Keywords:                    |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------

Comment (by Mariusz Felisiak):

 > If we go with list[Optional[Expression]] then we don't have to do any
 len based special casing when dealing with optional sub-expressions but it
 means that checks of the form len(source_expressions) are not adequate;
 they must exclude None values. I guess we could provide a property/method
 that excludes them if this is a common pattern.

 Thanks for checking. I'd choose `list[Optional[Expression]]` and `None`
 for empty optional expressions. However, Alex's
 [https://github.com/django/django/pull/16064 PR] is more suitable for
 backporting. We can standardized the behavior for optional sub-expressions
 in a separate cleanup targeted only to the `main` branch.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34016#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/010701834764cdc0-e375d137-cb3f-4b76-938f-175f75751cb8-000000%40eu-central-1.amazonses.com.

Reply via email to