Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type hints in SearchCommands #2817

Merged
merged 3 commits into from
Aug 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions redis/commands/search/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def info(self):
return dict(zip(it, it))

def get_params_args(
self, query_params: Union[Dict[str, Union[str, int, float]], None]
self, query_params: Union[Dict[str, Union[str, int, float, bytes]], None]
):
if query_params is None:
return []
Expand All @@ -385,7 +385,9 @@ def get_params_args(
args.append(value)
return args

def _mk_query_args(self, query, query_params: Dict[str, Union[str, int, float]]):
def _mk_query_args(
self, query, query_params: Union[Dict[str, Union[str, int, float, bytes]], None]
):
args = [self.index_name]

if isinstance(query, str):
Expand All @@ -402,7 +404,7 @@ def _mk_query_args(self, query, query_params: Dict[str, Union[str, int, float]])
def search(
self,
query: Union[str, Query],
query_params: Dict[str, Union[str, int, float]] = None,
query_params: Union[Dict[str, Union[str, int, float, bytes]], None] = None,
):
"""
Search the index for a given query, and return a result of documents
Expand Down