Skip to content

Commit db6922d

Browse files
feat(clients): allow batch size on objects helper [skip-bc] (generated)
algolia/api-clients-automation#4172 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 1cf0d00 commit db6922d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

algoliasearch/search/client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ async def save_objects(
504504
index_name: str,
505505
objects: List[Dict[str, Any]],
506506
wait_for_tasks: bool = False,
507+
batch_size: int = 1000,
507508
request_options: Optional[Union[dict, RequestOptions]] = None,
508509
) -> List[BatchResponse]:
509510
"""
@@ -514,6 +515,7 @@ async def save_objects(
514515
objects=objects,
515516
action=Action.ADDOBJECT,
516517
wait_for_tasks=wait_for_tasks,
518+
batch_size=batch_size,
517519
request_options=request_options,
518520
)
519521

@@ -522,6 +524,7 @@ async def delete_objects(
522524
index_name: str,
523525
object_ids: List[str],
524526
wait_for_tasks: bool = False,
527+
batch_size: int = 1000,
525528
request_options: Optional[Union[dict, RequestOptions]] = None,
526529
) -> List[BatchResponse]:
527530
"""
@@ -532,6 +535,7 @@ async def delete_objects(
532535
objects=[{"objectID": id} for id in object_ids],
533536
action=Action.DELETEOBJECT,
534537
wait_for_tasks=wait_for_tasks,
538+
batch_size=batch_size,
535539
request_options=request_options,
536540
)
537541

@@ -541,6 +545,7 @@ async def partial_update_objects(
541545
objects: List[Dict[str, Any]],
542546
create_if_not_exists: bool = False,
543547
wait_for_tasks: bool = False,
548+
batch_size: int = 1000,
544549
request_options: Optional[Union[dict, RequestOptions]] = None,
545550
) -> List[BatchResponse]:
546551
"""
@@ -553,6 +558,7 @@ async def partial_update_objects(
553558
if create_if_not_exists
554559
else Action.PARTIALUPDATEOBJECTNOCREATE,
555560
wait_for_tasks=wait_for_tasks,
561+
batch_size=batch_size,
556562
request_options=request_options,
557563
)
558564

@@ -5526,6 +5532,7 @@ def save_objects(
55265532
index_name: str,
55275533
objects: List[Dict[str, Any]],
55285534
wait_for_tasks: bool = False,
5535+
batch_size: int = 1000,
55295536
request_options: Optional[Union[dict, RequestOptions]] = None,
55305537
) -> List[BatchResponse]:
55315538
"""
@@ -5536,6 +5543,7 @@ def save_objects(
55365543
objects=objects,
55375544
action=Action.ADDOBJECT,
55385545
wait_for_tasks=wait_for_tasks,
5546+
batch_size=batch_size,
55395547
request_options=request_options,
55405548
)
55415549

@@ -5544,6 +5552,7 @@ def delete_objects(
55445552
index_name: str,
55455553
object_ids: List[str],
55465554
wait_for_tasks: bool = False,
5555+
batch_size: int = 1000,
55475556
request_options: Optional[Union[dict, RequestOptions]] = None,
55485557
) -> List[BatchResponse]:
55495558
"""
@@ -5554,6 +5563,7 @@ def delete_objects(
55545563
objects=[{"objectID": id} for id in object_ids],
55555564
action=Action.DELETEOBJECT,
55565565
wait_for_tasks=wait_for_tasks,
5566+
batch_size=batch_size,
55575567
request_options=request_options,
55585568
)
55595569

@@ -5563,6 +5573,7 @@ def partial_update_objects(
55635573
objects: List[Dict[str, Any]],
55645574
create_if_not_exists: bool = False,
55655575
wait_for_tasks: bool = False,
5576+
batch_size: int = 1000,
55665577
request_options: Optional[Union[dict, RequestOptions]] = None,
55675578
) -> List[BatchResponse]:
55685579
"""
@@ -5575,6 +5586,7 @@ def partial_update_objects(
55755586
if create_if_not_exists
55765587
else Action.PARTIALUPDATEOBJECTNOCREATE,
55775588
wait_for_tasks=wait_for_tasks,
5589+
batch_size=batch_size,
55785590
request_options=request_options,
55795591
)
55805592

0 commit comments

Comments
 (0)