Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Nov 17, 2023
1 parent 10ddd61 commit 71ca2b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _search_documents(self, **kwargs) -> List[Document]:
"""

top_k = kwargs.get("size")
if top_k is None and 'knn' in kwargs and 'k' in kwargs["knn"]:
if top_k is None and "knn" in kwargs and "k" in kwargs["knn"]:
top_k = kwargs["knn"]["k"]

documents: List[Document] = []
Expand Down
4 changes: 2 additions & 2 deletions document_stores/elasticsearch/tests/test_document_store.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SPDX-FileCopyrightText: 2023-present Silvano Cerza <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
import random
from typing import List
from unittest.mock import patch
import random

import pandas as pd
import pytest
Expand Down Expand Up @@ -316,7 +316,7 @@ def test_embedding_retrieval_pagination(self, docstore: ElasticsearchDocumentSto
Test that handling of pagination works as expected, when the matching documents are > 10.
"""

docs = [Document(content=f"Document {i}", embedding=[random.random() for _ in range(4)]) for i in range(20)]
docs = [Document(content=f"Document {i}", embedding=[random.random() for _ in range(4)]) for i in range(20)] # noqa: S311

docstore.write_documents(docs)
results = docstore._embedding_retrieval(query_embedding=[0.1, 0.1, 0.1, 0.1], top_k=11, filters={})
Expand Down

0 comments on commit 71ca2b0

Please sign in to comment.