1919 BatchCollectionProtocolAsync ,
2020 _BatchWrapper ,
2121 _BatchWrapperAsync ,
22- _ContextManagerWrapper ,
23- _ContextManagerWrapperAsync ,
22+ _ContextManagerAsync ,
23+ _ContextManagerSync ,
2424)
2525from weaviate .collections .batch .sync import _BatchBaseSync
2626from weaviate .collections .classes .config import ConsistencyLevel , Vectorizers
@@ -88,14 +88,14 @@ def add_reference(
8888class _BatchCollectionSync (Generic [Properties ], _BatchBaseSync ):
8989 def __init__ (
9090 self ,
91- executor : ThreadPoolExecutor ,
9291 connection : ConnectionSync ,
9392 consistency_level : Optional [ConsistencyLevel ],
9493 results : _BatchDataWrapper ,
95- batch_mode : _BatchMode ,
9694 name : str ,
9795 tenant : Optional [str ],
98- vectorizer_batching : bool ,
96+ executor : Optional [ThreadPoolExecutor ] = None ,
97+ batch_mode : Optional [_BatchMode ] = None ,
98+ vectorizer_batching : bool = False ,
9999 ) -> None :
100100 super ().__init__ (
101101 connection = connection ,
@@ -184,11 +184,11 @@ async def add_reference(
184184BatchCollection = _BatchCollection
185185BatchCollectionSync = _BatchCollectionSync
186186BatchCollectionAsync = _BatchCollectionAsync
187- CollectionBatchingContextManager = _ContextManagerWrapper [
187+ CollectionBatchingContextManager = _ContextManagerSync [
188188 Union [BatchCollection [Properties ], BatchCollectionSync [Properties ]],
189189 BatchCollectionProtocol [Properties ],
190190]
191- CollectionBatchingContextManagerAsync = _ContextManagerWrapperAsync [
191+ CollectionBatchingContextManagerAsync = _ContextManagerAsync [
192192 BatchCollectionProtocolAsync [Properties ]
193193]
194194
@@ -239,7 +239,7 @@ def __create_batch_and_reset(
239239 self ._vectorizer_batching = False
240240
241241 self ._batch_data = _BatchDataWrapper () # clear old data
242- return _ContextManagerWrapper (
242+ return _ContextManagerSync (
243243 batch_client (
244244 connection = self ._connection ,
245245 consistency_level = self ._consistency_level ,
@@ -311,9 +311,9 @@ def stream(
311311 concurrency: The number of concurrent requests when sending batches. This controls the number of concurrent requests
312312 made to Weaviate. If not provided, the default value is 1.
313313 """
314- if self ._connection ._weaviate_version .is_lower_than (1 , 34 , 0 ):
314+ if self ._connection ._weaviate_version .is_lower_than (1 , 36 , 0 ):
315315 raise WeaviateUnsupportedFeatureError (
316- "Server-side batching" , str (self ._connection ._weaviate_version ), "1.34 .0"
316+ "Server-side batching" , str (self ._connection ._weaviate_version ), "1.36 .0"
317317 )
318318 self ._batch_mode = _ServerSideBatching (
319319 # concurrency=concurrency
@@ -338,7 +338,7 @@ def __init__(
338338
339339 def __create_batch_and_reset (self ):
340340 self ._batch_data = _BatchDataWrapper () # clear old data
341- return _ContextManagerWrapperAsync (
341+ return _ContextManagerAsync (
342342 BatchCollectionAsync (
343343 connection = self ._connection ,
344344 consistency_level = self ._consistency_level ,
@@ -371,9 +371,9 @@ def stream(
371371 concurrency: The number of concurrent requests when sending batches. This controls the number of concurrent requests
372372 made to Weaviate. If not provided, the default value is 1.
373373 """
374- if self ._connection ._weaviate_version .is_lower_than (1 , 34 , 0 ):
374+ if self ._connection ._weaviate_version .is_lower_than (1 , 36 , 0 ):
375375 raise WeaviateUnsupportedFeatureError (
376- "Server-side batching" , str (self ._connection ._weaviate_version ), "1.34 .0"
376+ "Server-side batching" , str (self ._connection ._weaviate_version ), "1.36 .0"
377377 )
378378 self ._batch_mode = _ServerSideBatching (
379379 # concurrency=concurrency
0 commit comments