Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#33799 closed Bug (fixed)

abulk_create() doesn't accept upsert parameters (update_conflicts, update_fields, unique_fields)

Reported by: Dhruva Patil Owned by: Dhruva Patil
Component: Database layer (models, ORM) Version: 4.1
Severity: Release blocker Keywords: async orm
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

abulk_create doesn't accept newly added upsert parameters even though the (preview) docs say it does.

File /usr/local/lib/python3.8/site-packages/django/db/models/manager.py:85, in BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_method(self, *args, **kwargs)
     84 def manager_method(self, *args, **kwargs):
---> 85     return getattr(self.get_queryset(), name)(*args, **kwargs)

TypeError: abulk_create() got an unexpected keyword argument 'update_conflicts'

Change History (6)

comment:1 by Dhruva Patil, 3 years ago

Has patch: set

comment:2 by Mariusz Felisiak, 3 years ago

Severity: NormalRelease blocker
Summary: abulk_create doesn't accept upsert parameters (update_conflicts, update_fields, unique_fields)abulk_create() doesn't accept upsert parameters (update_conflicts, update_fields, unique_fields)
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

Thanks for the report.

comment:3 by Mariusz Felisiak, 3 years ago

Triage Stage: AcceptedReady for checkin

in reply to:  2 comment:4 by Dhruva Patil, 3 years ago

Replying to Mariusz Felisiak:

Thanks for the report.

No worries!

I've raised a PR for the same: https://github.com/django/django/pull/15788

Let me know if any changes are required.

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In c627226d:

Fixed #33799, Refs #31685 -- Added parameters for updating conflicts to QuerySeta.abulk_create().

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 531c96de:

[4.1.x] Fixed #33799, Refs #31685 -- Added parameters for updating conflicts to QuerySeta.abulk_create().

Backport of c627226d05dd52aef59447dcfb29cec2c2b11b8a from main

Note: See TracTickets for help on using tickets.
Back to Top