From 4d9c1033a827325222b40f5536fd32e8d846aa58 Mon Sep 17 00:00:00 2001 From: Alex DelVecchio Date: Wed, 17 Aug 2022 19:27:07 -0400 Subject: [PATCH] Fix regression in '.bulk_update()' annotations for Django 3.2 --- django-stubs/db/models/manager.pyi | 2 +- django-stubs/db/models/query.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/db/models/manager.pyi b/django-stubs/db/models/manager.pyi index 9383f6225..95960e7f1 100644 --- a/django-stubs/db/models/manager.pyi +++ b/django-stubs/db/models/manager.pyi @@ -56,7 +56,7 @@ class BaseManager(Generic[_T]): def bulk_create( self, objs: Iterable[_T], batch_size: Optional[int] = ..., ignore_conflicts: bool = ... ) -> List[_T]: ... - def bulk_update(self, objs: Iterable[_T], fields: Sequence[str], batch_size: Optional[int] = ...) -> int: ... + def bulk_update(self, objs: Iterable[_T], fields: Iterable[str], batch_size: Optional[int] = ...) -> Optional[int]: ... def get_or_create(self, defaults: Optional[MutableMapping[str, Any]] = ..., **kwargs: Any) -> Tuple[_T, bool]: ... def update_or_create( self, defaults: Optional[MutableMapping[str, Any]] = ..., **kwargs: Any diff --git a/django-stubs/db/models/query.pyi b/django-stubs/db/models/query.pyi index 2ad08b1b5..746083978 100644 --- a/django-stubs/db/models/query.pyi +++ b/django-stubs/db/models/query.pyi @@ -62,7 +62,7 @@ class _QuerySet(Generic[_T, _Row], Collection[_Row], Reversible[_Row], Sized): def bulk_create( self, objs: Iterable[_T], batch_size: Optional[int] = ..., ignore_conflicts: bool = ... ) -> List[_T]: ... - def bulk_update(self, objs: Iterable[_T], fields: Iterable[str], batch_size: Optional[int] = ...) -> int: ... + def bulk_update(self, objs: Iterable[_T], fields: Iterable[str], batch_size: Optional[int] = ...) -> Optional[int]: ... def get_or_create(self, defaults: Optional[MutableMapping[str, Any]] = ..., **kwargs: Any) -> Tuple[_T, bool]: ... def update_or_create( self, defaults: Optional[MutableMapping[str, Any]] = ..., **kwargs: Any