2
2
3
3
import contextlib
4
4
import logging
5
- from collections .abc import Collection , Iterable , Mapping
5
+ from collections .abc import Collection , Iterable , Mapping , Sequence
6
6
from typing import TYPE_CHECKING , Any , Protocol , TypeVar
7
7
8
8
from django .db import connections , router , transaction
@@ -80,7 +80,7 @@ class RegionOutboxProducingManager(BaseManager[_RM]):
80
80
Provides bulk update and delete methods that respect outbox creation.
81
81
"""
82
82
83
- def bulk_create (self , objs : Iterable [_RM ], * args : Any , ** kwds : Any ) -> Collection [_RM ]:
83
+ def bulk_create (self , objs : Iterable [_RM ], * args : Any , ** kwds : Any ) -> list [_RM ]:
84
84
from sentry .models .outbox import outbox_context
85
85
86
86
tuple_of_objs : tuple [_RM , ...] = tuple (objs )
@@ -107,7 +107,9 @@ def bulk_create(self, objs: Iterable[_RM], *args: Any, **kwds: Any) -> Collectio
107
107
type (outboxes [0 ]).objects .bulk_create (outboxes )
108
108
return super ().bulk_create (tuple_of_objs , * args , ** kwds )
109
109
110
- def bulk_update (self , objs : Iterable [_RM ], fields : list [str ], * args : Any , ** kwds : Any ) -> Any :
110
+ def bulk_update (
111
+ self , objs : Iterable [_RM ], fields : Sequence [str ], * args : Any , ** kwds : Any
112
+ ) -> Any :
111
113
from sentry .models .outbox import outbox_context
112
114
113
115
tuple_of_objs : tuple [_RM , ...] = tuple (objs )
@@ -262,7 +264,7 @@ class ControlOutboxProducingManager(BaseManager[_CM]):
262
264
Provides bulk update and delete methods that respect outbox creation.
263
265
"""
264
266
265
- def bulk_create (self , objs : Iterable [_CM ], * args : Any , ** kwds : Any ) -> Collection [_CM ]:
267
+ def bulk_create (self , objs : Iterable [_CM ], * args : Any , ** kwds : Any ) -> list [_CM ]:
266
268
from sentry .models .outbox import outbox_context
267
269
268
270
tuple_of_objs : tuple [_CM , ...] = tuple (objs )
@@ -289,7 +291,9 @@ def bulk_create(self, objs: Iterable[_CM], *args: Any, **kwds: Any) -> Collectio
289
291
type (outboxes [0 ]).objects .bulk_create (outboxes )
290
292
return super ().bulk_create (tuple_of_objs , * args , ** kwds )
291
293
292
- def bulk_update (self , objs : Iterable [_CM ], fields : list [str ], * args : Any , ** kwds : Any ) -> Any :
294
+ def bulk_update (
295
+ self , objs : Iterable [_CM ], fields : Sequence [str ], * args : Any , ** kwds : Any
296
+ ) -> Any :
293
297
from sentry .models .outbox import outbox_context
294
298
295
299
tuple_of_objs : tuple [_CM , ...] = tuple (objs )
0 commit comments