Skip to content

Commit

Permalink
flake8 fix max-line-length
Browse files Browse the repository at this point in the history
  • Loading branch information
MuddyHope committed Aug 29, 2024
1 parent 007f40f commit 59f2098
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion meilisearch/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ def index(self, uid: str) -> Index:
return Index(self.config, uid=uid)
raise ValueError("The index UID should not be None")

def multi_search(self, queries: Sequence[Mapping[str, Any]], federation: Optional[Dict[str, Any]] = None) -> Dict[str, List[Dict[str, Any]]]:
def multi_search(self, queries: Sequence[Mapping[str, Any]],
federation: Optional[Dict[str, Any]] = None) -> Dict[str, List[Dict[str, Any]]]:
"""Multi-index search.
Parameters
Expand Down
17 changes: 12 additions & 5 deletions tests/client/test_client_multi_search_meilisearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def test_multi_search_on_no_index(client):
client.multi_search([{"indexUid": "indexDoesNotExist", "q": ""}])


def test_multi_search_with_no_value_in_federation(client, empty_index, index_with_documents):
def test_multi_search_with_no_value_in_federation(client, empty_index,
index_with_documents):
"""Tests multi-search with federation, but no value"""
index_with_documents()
empty_index("indexB")
Expand All @@ -48,11 +49,15 @@ def test_multi_search_with_no_value_in_federation(client, empty_index, index_wit
assert response["limit"] == 20
assert response["offset"] == 0

def test_multi_search_with_offset_and_limit_in_federation(client, index_with_documents):

def test_multi_search_with_offset_and_limit_in_federation(
client,
index_with_documents):
"""Tests multi-search with federation, with offset and limit value"""
index_with_documents()
response = client.multi_search([{"indexUid": INDEX_UID, "q": ""}], {"offset": 2, "limit": 2})

response = client.multi_search([{"indexUid": INDEX_UID, "q": ""}],
{"offset": 2, "limit": 2})

assert "results" not in response
assert len(response["hits"]) == 2
assert "_federation" in response["hits"][0]
Expand All @@ -63,7 +68,9 @@ def test_multi_search_with_offset_and_limit_in_federation(client, index_with_doc
def test_multi_search_with_federation_options(client, index_with_documents):
"""Tests multi-search with federation, with federation options"""
index_with_documents()
response = client.multi_search([{"indexUid": INDEX_UID, "q": "", "federationOptions": {"weight": 0.99}}], {"limit": 2})
response = client.multi_search(
[{"indexUid": INDEX_UID, "q": "",
"federationOptions": {"weight": 0.99}}], {"limit": 2})

assert "results" not in response
assert response["hits"][0]["_federation"]["indexUid"] == INDEX_UID
Expand Down

0 comments on commit 59f2098

Please sign in to comment.