@@ -58,9 +58,8 @@ async def delete(self) -> int:
5858 return response .status_code
5959
6060 async def delete_if_exists (self ) -> bool :
61- """
62- Deletes the index if it already exists
63- """
61+ """Deletes the index if it already exists"""
62+
6463 try :
6564 await self .delete ()
6665 return True
@@ -70,9 +69,8 @@ async def delete_if_exists(self) -> bool:
7069 return False
7170
7271 async def update (self , primary_key : str = None ) -> Index :
73- """
74- Update the index primary-key.
75- """
72+ """Update the index primary-key"""
73+
7674 payload = {}
7775 if primary_key is not None :
7876 payload ["primaryKey" ] = primary_key
@@ -157,13 +155,13 @@ async def get_update_status(self, update_id: int) -> UpdateStatus:
157155 async def wait_for_pending_update (
158156 self , update_id : int , timeout_in_ms : int = 5000 , interval_in_ms : int = 50
159157 ) -> UpdateStatus :
160- """
161- Wait until MeiliSearch processes an update, and get its status.
158+ """Wait until MeiliSearch processes an update, and get its status.
162159
163160 update_id: identifier of the update to retrieve
164161 timeout_in_ms (optional): time the method should wait before raising a MeiliSearchTimeoutError
165162 interval_in_ms (optional): time interval the method should wait (sleep) between requests
166163 """
164+
167165 start_time = datetime .now ()
168166 elapsed_time = 0.0
169167 while elapsed_time < timeout_in_ms :
@@ -280,9 +278,7 @@ async def add_documents(
280278 async def add_documents_in_batches (
281279 self , documents : list [dict ], batch_size : int = 1000 , primary_key : Optional [str ] = None
282280 ) -> list [UpdateId ]:
283- """
284- Splits documents into batches to reduce RAM usage with indexing.
285- """
281+ """Splits documents into batches to reduce RAM usage with indexing"""
286282
287283 update_ids : list [UpdateId ] = []
288284
@@ -295,9 +291,7 @@ async def add_documents_in_batches(
295291 async def add_documents_from_file (
296292 self , file_path : Path | str , primary_key : Optional [str ] = None
297293 ) -> UpdateId :
298- """
299- Add documents to the index from a json file.
300- """
294+ """Add documents to the index from a json file"""
301295
302296 if isinstance (file_path , str ):
303297 file_path = Path (file_path )
@@ -314,9 +308,7 @@ async def add_documents_from_file(
314308 async def add_documents_from_file_in_batches (
315309 self , file_path : Path | str , batch_size : int = 1000 , primary_key : Optional [str ] = None
316310 ) -> list [UpdateId ]:
317- """
318- Add documents to the index from a json file in batches to reduce RAM usage.
319- """
311+ """Add documents to the index from a json file in batches to reduce RAM usage"""
320312
321313 if isinstance (file_path , str ):
322314 file_path = Path (file_path )
@@ -349,9 +341,7 @@ async def update_documents(
349341 async def update_documents_in_batches (
350342 self , documents : list [dict ], batch_size : int = 1000 , primary_key : Optional [str ] = None
351343 ) -> list [UpdateId ]:
352- """
353- Splits documents into batches to reduce RAM usage with indexing.
354- """
344+ """Splits documents into batches to reduce RAM usage with indexing"""
355345
356346 update_ids : list [UpdateId ] = []
357347
@@ -364,9 +354,7 @@ async def update_documents_in_batches(
364354 async def update_documents_from_file (
365355 self , file_path : Path | str , primary_key : Optional [str ] = None
366356 ) -> UpdateId :
367- """
368- Update documents in the index from a json file.
369- """
357+ """Update documents in the index from a json file"""
370358
371359 if isinstance (file_path , str ):
372360 file_path = Path (file_path )
@@ -383,9 +371,7 @@ async def update_documents_from_file(
383371 async def update_documents_from_file_in_batches (
384372 self , file_path : Path | str , batch_size : int = 1000 , primary_key : Optional [str ] = None
385373 ) -> list [UpdateId ]:
386- """
387- Update documents in the index from a json file in batches to reduce RAM usage.
388- """
374+ """Update documents in the index from a json file in batches to reduce RAM usage"""
389375
390376 if isinstance (file_path , str ):
391377 file_path = Path (file_path )
@@ -623,8 +609,7 @@ async def reset_attributes_for_faceting(self) -> UpdateId:
623609
624610 @staticmethod
625611 def _iso_to_date_time (iso_date : Optional [datetime | str ]) -> Optional [datetime ]:
626- """
627- The microseconds from MeiliSearch are sometimes too long for python to convert so this
612+ """The microseconds from MeiliSearch are sometimes too long for python to convert so this
628613 strips off the last digits to shorten it when that happens.
629614 """
630615
0 commit comments