Skip to content

Commit 89cdfdf

Browse files
fix(specs): allow null records in getObjects response (generated)
algolia/api-clients-automation#6582 Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent 1ec1827 commit 89cdfdf

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

algoliasearch/http/chunked_helper_options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from dataclasses import dataclass
2+
from typing import ClassVar
23

34

45
@dataclass
@@ -7,4 +8,6 @@ class ChunkedHelperOptions:
78
Optional configuration for chunked helpers that batch records and poll for task completion.
89
"""
910

11+
DEFAULT_REPLACE_ALL_OBJECTS_MAX_RETRIES: ClassVar[int] = 800
12+
1013
max_retries: int = 100

algoliasearch/search/client.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,9 @@ async def replace_all_objects_with_transformation(
735735
raise ValueError(
736736
"`transformation_options` must be set on `SearchConfig` before creating the client, or via `client.set_transformation_options(...)` before calling this method. It defaults to the Ingestion API defaults. See https://www.algolia.com/doc/libraries/sdk/methods/ingestion/"
737737
)
738-
chunked_options = chunked_options or ChunkedHelperOptions()
738+
chunked_options = chunked_options or ChunkedHelperOptions(
739+
max_retries=ChunkedHelperOptions.DEFAULT_REPLACE_ALL_OBJECTS_MAX_RETRIES
740+
)
739741
tmp_index_name = self.create_temporary_name(index_name)
740742

741743
try:
@@ -818,7 +820,9 @@ async def replace_all_objects(
818820
819821
See https://api-clients-automation.netlify.app/docs/custom-helpers/#replaceallobjects for implementation details.
820822
"""
821-
chunked_options = chunked_options or ChunkedHelperOptions()
823+
chunked_options = chunked_options or ChunkedHelperOptions(
824+
max_retries=ChunkedHelperOptions.DEFAULT_REPLACE_ALL_OBJECTS_MAX_RETRIES
825+
)
822826
tmp_index_name = self.create_temporary_name(index_name)
823827

824828
try:
@@ -6307,7 +6311,9 @@ def replace_all_objects_with_transformation(
63076311
raise ValueError(
63086312
"`transformation_options` must be set on `SearchConfig` before creating the client, or via `client.set_transformation_options(...)` before calling this method. It defaults to the Ingestion API defaults. See https://www.algolia.com/doc/libraries/sdk/methods/ingestion/"
63096313
)
6310-
chunked_options = chunked_options or ChunkedHelperOptions()
6314+
chunked_options = chunked_options or ChunkedHelperOptions(
6315+
max_retries=ChunkedHelperOptions.DEFAULT_REPLACE_ALL_OBJECTS_MAX_RETRIES
6316+
)
63116317
tmp_index_name = self.create_temporary_name(index_name)
63126318

63136319
try:
@@ -6390,7 +6396,9 @@ def replace_all_objects(
63906396
63916397
See https://api-clients-automation.netlify.app/docs/custom-helpers/#replaceallobjects for implementation details.
63926398
"""
6393-
chunked_options = chunked_options or ChunkedHelperOptions()
6399+
chunked_options = chunked_options or ChunkedHelperOptions(
6400+
max_retries=ChunkedHelperOptions.DEFAULT_REPLACE_ALL_OBJECTS_MAX_RETRIES
6401+
)
63946402
tmp_index_name = self.create_temporary_name(index_name)
63956403

63966404
try:

algoliasearch/search/models/get_objects_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class GetObjectsResponse(BaseModel):
3535

3636
message: Optional[str] = None
3737
""" An optional status message. """
38-
results: List[object]
38+
results: List[Optional[object]]
3939
""" Retrieved records. """
4040

4141
model_config = ConfigDict(

0 commit comments

Comments
 (0)