Skip to content

Commit 0ea889b

Browse files
committed
fix: python
1 parent a1c4d5f commit 0ea889b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

templates/python/api.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ from algoliasearch.search.models import (
1111
ReplaceAllObjectsWithTransformationResponse,
1212
ScopeType,
1313
SecuredApiKeyRestrictions,
14+
WatchResponse,
1415
)
1516

16-
from algoliasearch.ingestion.models import (WatchResponse)
17+
from algoliasearch.ingestion.models import WatchResponse as IngestionWatchResponse
1718
from algoliasearch.ingestion.config import IngestionConfig
1819
from algoliasearch.ingestion.client import (IngestionClient, IngestionClientSync)
1920
from algoliasearch.ingestion.models import Action as IngestionAction

templates/python/search_helpers.mustache

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
wait_for_tasks: bool = False,
300300
batch_size: int = 1000,
301301
request_options: Optional[Union[dict, RequestOptions]] = None,
302-
) -> List[WatchResponse]:
302+
) -> List[IngestionWatchResponse]:
303303
"""
304304
Helper: Similar to the `save_objects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must've been passed to the client's config at instantiation.
305305
"""
@@ -342,7 +342,7 @@
342342
wait_for_tasks: bool = False,
343343
batch_size: int = 1000,
344344
request_options: Optional[Union[dict, RequestOptions]] = None,
345-
) -> List[WatchResponse]:
345+
) -> List[IngestionWatchResponse]:
346346
"""
347347
Helper: Similar to the `partial_update_objects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must've been passed to the client instantiation method.
348348
"""
@@ -443,9 +443,11 @@
443443
index_name=tmp_index_name, task_id=move_operation_response.task_id
444444
)
445445
446+
search_watch_responses: List[WatchResponse] = [WatchResponse.model_validate(wr.model_dump()) for wr in watch_responses]
447+
446448
return ReplaceAllObjectsWithTransformationResponse(
447449
copy_operation_response=copy_operation_response,
448-
watch_responses=watch_responses,
450+
watch_responses=search_watch_responses,
449451
move_operation_response=move_operation_response,
450452
)
451453
except Exception as e:

0 commit comments

Comments
 (0)