#37143: aiterator() missing check for chunk_size=None after prefetch_related()
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                     Type:  Bug
       Status:  new                  |                Component:  Database
                                     |  layer (models, ORM)
      Version:  5.0                  |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 `aiterator()` is missing the
 
[https://github.com/django/django/blob/4bbc27c8686f10f9556cef02dbfa9f5157fbcf56/django/db/models/query.py#L566
 check] found in `iterator()` for `chunk_size=None` after
 `prefetch_related()`:

 `iterator()` version:
 {{{#!py
         if chunk_size is None:
             if self._prefetch_related_lookups:
                 raise ValueError(
                     "chunk_size must be provided when using
 QuerySet.iterator() after "
                     "prefetch_related()."
                 )
 }}}

 I think this should have been implemented in #34331.

 The rationale for the check was to alert users that the number of queries
 could spike with small batch sizes, which you might be tempted to minimize
 if prioritizing memory optimizations.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37143>
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/0107019e936bf7a1-4673f328-3fab-4891-9248-79cf488b2d13-000000%40eu-central-1.amazonses.com.

Reply via email to