sbdchd / django-types

:doughnut: Type stubs for Django
MIT License
188 stars 62 forks source link

incorrect optional arguments of bulk_create #164

Open matsui-goga opened 1 year ago

matsui-goga commented 1 year ago

django-stubs/db/models/query.pyi has the definition of bulk_create and its async variant.

def bulk_create(
        self,
        objs: Iterable[_T],
        batch_size: Optional[int] = ...,
        ignore_conflicts: bool = ...,
        update_conflicts: Optional[Sequence[str]] = ...,
        update_fields: Optional[Sequence[str]] = ...,
    ) -> List[_T]: ...

There are two mistakes.

  1. update_conflits type should be bool
  2. there is another optional argument unique_fields whose type is Optional[Sequence[str]]