Skip to content

Commit

Permalink
fix(qdrant): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-science committed Mar 7, 2024
1 parent 7be99db commit 388911e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __init__(
self.payload_field_to_index = payload_field_to_index

# Make sure the collection is properly set up
self._set_up_collection(index, embedding_dim, on_disk, recreate_index, similarity, payload_field_to_index)
self._set_up_collection(index, embedding_dim, recreate_index, similarity, on_disk, payload_field_to_index)

self.embedding_dim = embedding_dim
self.on_disk = on_disk
Expand Down Expand Up @@ -355,9 +355,9 @@ def _set_up_collection(
self,
collection_name: str,
embedding_dim: int,
on_disk: bool, # noqa: FBT001
recreate_collection: bool, # noqa: FBT001
similarity: str,
on_disk: bool = False, # noqa: FBT001
payload_field_to_index: Optional[List[dict]] = None,
):
distance = self._get_distance(similarity)
Expand Down
6 changes: 6 additions & 0 deletions integrations/qdrant/tests/test_dict_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_to_dict():
"path": None,
"index": "test",
"embedding_dim": 768,
"on_disk": False,
"content_field": "content",
"name_field": "name",
"embedding_field": "embedding",
Expand All @@ -42,6 +43,7 @@ def test_to_dict():
"metadata": {},
"write_batch_size": 100,
"scroll_size": 10000,
"payload_field_to_index": None,
},
}

Expand All @@ -57,6 +59,7 @@ def test_from_dict():
"location": ":memory:",
"index": "test",
"embedding_dim": 768,
"on_disk": False,
"content_field": "content",
"name_field": "name",
"embedding_field": "embedding",
Expand All @@ -72,6 +75,7 @@ def test_from_dict():
"metadata": {},
"write_batch_size": 1000,
"scroll_size": 10000,
"payload_field_to_index": None,
},
}
)
Expand All @@ -82,6 +86,7 @@ def test_from_dict():
document_store.content_field == "content",
document_store.name_field == "name",
document_store.embedding_field == "embedding",
document_store.on_disk is False,
document_store.similarity == "cosine",
document_store.return_embedding is False,
document_store.progress_bar,
Expand All @@ -101,5 +106,6 @@ def test_from_dict():
document_store.write_batch_size == 1000,
document_store.scroll_size == 10000,
document_store.api_key == Secret.from_env_var("ENV_VAR", strict=False),
document_store.payload_field_to_index is None,
]
)
2 changes: 2 additions & 0 deletions integrations/qdrant/tests/test_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_to_dict(self):
"path": None,
"index": "test",
"embedding_dim": 768,
"on_disk": False,
"content_field": "content",
"name_field": "name",
"embedding_field": "embedding",
Expand All @@ -62,6 +63,7 @@ def test_to_dict(self):
"metadata": {},
"write_batch_size": 100,
"scroll_size": 10000,
"payload_field_to_index": None,
},
},
"filters": None,
Expand Down

0 comments on commit 388911e

Please sign in to comment.