#35159: dumpdata does not work in 5.0.1 on QuerySets with prefetch_related
-------------------------------------+-------------------------------------
Reporter: Andrea F | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: 5.0
(Management commands) | Keywords: dumpdata chunk_size
Severity: Normal | iterator prefetch_related
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
The `./manage.py dumpdata` management command calls `iterator()` on the
QuerySets of the models, but it does not pass
`chunk_size`([https://github.com/django/django/blob/main/django/core/management/commands/dumpdata.py#L222]).
On model QuerySets that include `prefetch_related`, this now (with 5.0)
causes this error while running `dumpdata`:
> CommandError: Unable to serialize database: chunk_size must be provided
when using QuerySet.iterator() after prefetch_related().
Proposed fix is to pass a suitable `chunk_size` parameter to `iterator()`
within `handle()` in `dumpdata.py`.
--
Ticket URL: <https://code.djangoproject.com/ticket/35159>
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/0107018d5c9043bb-d34766ef-56c5-4845-8ad4-1ce1274cafbc-000000%40eu-central-1.amazonses.com.