#30827: bulk_create batch_size param overrides the compatible batch size calculation -----------------------------------------+------------------------ Reporter: Ahmet Kucuk | Owner: nobody Type: Bug | Status: new Component: Uncategorized | Version: 2.2 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 | -----------------------------------------+------------------------ At this line: https://github.com/django/django/blob/stable/2.2.x/django/db/models/query.py#L1197
batch_size param overrides compatible batch size calculation. This looks like a bug as bulk_update properly picks the minimum of two: https://github.com/django/django/blob/stable/2.2.x/django/db/models/query.py#L504 I suggest using similar batch_size = min(batch_size, max_batch_size) if batch_size else max_batch_size logic in bulk_create as well. I am happy to open a PR for it. -- Ticket URL: <https://code.djangoproject.com/ticket/30827> 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 https://groups.google.com/d/msgid/django-updates/053.30858440beaa25ce2e85282e8c8f1aa5%40djangoproject.com.