@@ -221,7 +221,7 @@ def create_index(
221221
222222 return self .execute_command (* args )
223223
224- def alter_schema_add (self , fields : List [str ]):
224+ def alter_schema_add (self , fields : Union [ Field , List [Field ] ]):
225225 """
226226 Alter the existing search index by adding new fields. The index
227227 must already exist.
@@ -336,11 +336,11 @@ def add_document(
336336 doc_id : str ,
337337 nosave : bool = False ,
338338 score : float = 1.0 ,
339- payload : bool = None ,
339+ payload : Optional [ bool ] = None ,
340340 replace : bool = False ,
341341 partial : bool = False ,
342342 language : Optional [str ] = None ,
343- no_create : str = False ,
343+ no_create : bool = False ,
344344 ** fields : List [str ],
345345 ):
346346 """
@@ -464,7 +464,7 @@ def info(self):
464464 return self ._parse_results (INFO_CMD , res )
465465
466466 def get_params_args (
467- self , query_params : Union [Dict [str , Union [str , int , float , bytes ]], None ]
467+ self , query_params : Optional [Dict [str , Union [str , int , float , bytes ]]]
468468 ):
469469 if query_params is None :
470470 return []
@@ -478,7 +478,7 @@ def get_params_args(
478478 return args
479479
480480 def _mk_query_args (
481- self , query , query_params : Union [Dict [str , Union [str , int , float , bytes ]], None ]
481+ self , query , query_params : Optional [Dict [str , Union [str , int , float , bytes ]]]
482482 ):
483483 args = [self .index_name ]
484484
@@ -528,7 +528,7 @@ def search(
528528 def explain (
529529 self ,
530530 query : Union [str , Query ],
531- query_params : Dict [str , Union [str , int , float ]] = None ,
531+ query_params : Optional [ Dict [str , Union [str , int , float , bytes ] ]] = None ,
532532 ):
533533 """Returns the execution plan for a complex query.
534534
@@ -543,7 +543,7 @@ def explain_cli(self, query: Union[str, Query]): # noqa
543543 def aggregate (
544544 self ,
545545 query : Union [AggregateRequest , Cursor ],
546- query_params : Dict [str , Union [str , int , float ]] = None ,
546+ query_params : Optional [ Dict [str , Union [str , int , float , bytes ] ]] = None ,
547547 ):
548548 """
549549 Issue an aggregation query.
@@ -598,7 +598,7 @@ def profile(
598598 self ,
599599 query : Union [Query , AggregateRequest ],
600600 limited : bool = False ,
601- query_params : Optional [Dict [str , Union [str , int , float ]]] = None ,
601+ query_params : Optional [Dict [str , Union [str , int , float , bytes ]]] = None ,
602602 ):
603603 """
604604 Performs a search or aggregate command and collects performance
@@ -936,7 +936,7 @@ async def info(self):
936936 async def search (
937937 self ,
938938 query : Union [str , Query ],
939- query_params : Dict [str , Union [str , int , float ]] = None ,
939+ query_params : Optional [ Dict [str , Union [str , int , float , bytes ] ]] = None ,
940940 ):
941941 """
942942 Search the index for a given query, and return a result of documents
@@ -968,7 +968,7 @@ async def search(
968968 async def aggregate (
969969 self ,
970970 query : Union [AggregateResult , Cursor ],
971- query_params : Dict [str , Union [str , int , float ]] = None ,
971+ query_params : Optional [ Dict [str , Union [str , int , float , bytes ] ]] = None ,
972972 ):
973973 """
974974 Issue an aggregation query.
0 commit comments