Skip to content

Commit b75170f

Browse files
committed
style: remove unused is_async parameter from _prepare_delete_all_request
The is_async parameter is no longer needed since wait_for_completion is always True for delete_all_documents operations
1 parent abe2ce4 commit b75170f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • integrations/opensearch/src/haystack_integrations/document_stores/opensearch

integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ async def delete_documents_async(
596596

597597
await async_bulk(**self._prepare_bulk_delete_request(document_ids=document_ids, is_async=True, refresh=refresh))
598598

599-
def _prepare_delete_all_request(self, *, is_async: bool, refresh: bool) -> dict[str, Any]:
599+
def _prepare_delete_all_request(self, *, refresh: bool) -> dict[str, Any]:
600600
return {
601601
"index": self._index,
602602
"body": {"query": {"match_all": {}}}, # Delete all documents
@@ -638,7 +638,7 @@ def delete_all_documents(self, recreate_index: bool = False, refresh: bool = Tru
638638

639639
else:
640640
result = self._client.delete_by_query(
641-
**self._prepare_delete_all_request(is_async=False, refresh=refresh)
641+
**self._prepare_delete_all_request(refresh=refresh)
642642
)
643643
logger.info(
644644
"Deleted all the {n_docs} documents from the index '{index}'.",
@@ -681,7 +681,7 @@ async def delete_all_documents_async(self, recreate_index: bool = False, refresh
681681
else:
682682
# use delete_by_query for more efficient deletion without index recreation
683683
await self._async_client.delete_by_query(
684-
**self._prepare_delete_all_request(is_async=True, refresh=refresh)
684+
**self._prepare_delete_all_request(refresh=refresh)
685685
)
686686

687687
except Exception as e:

0 commit comments

Comments
 (0)