diff --git a/src/milvus_haystack/__about__.py b/src/milvus_haystack/__about__.py index 8402d78..4dcc8e0 100644 --- a/src/milvus_haystack/__about__.py +++ b/src/milvus_haystack/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2023-present Tuana Celik # # SPDX-License-Identifier: Apache-2.0 -__version__ = "0.0.7" +__version__ = "0.0.8" diff --git a/tests/test_document_store.py b/tests/test_document_store.py index 605de20..af48adc 100644 --- a/tests/test_document_store.py +++ b/tests/test_document_store.py @@ -10,18 +10,17 @@ logger = logging.getLogger(__name__) +DEFAULT_CONNECTION_ARGS = { + "uri": "http://localhost:19530", + # "uri": "./milvus_test.db", # This uri works for Milvus Lite +} + class TestDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest): @pytest.fixture def document_store(self) -> MilvusDocumentStore: return MilvusDocumentStore( - connection_args={ - "host": "localhost", - "port": "19530", - "user": "", - "password": "", - "secure": False, - }, + connection_args=DEFAULT_CONNECTION_ARGS, drop_old=True, ) @@ -61,7 +60,7 @@ def test_to_and_from_dict(self, document_store: MilvusDocumentStore): "collection_name": "HaystackCollection", "collection_description": "", "collection_properties": None, - "connection_args": {"host": "localhost", "port": "19530", "user": "", "password": "", "secure": False}, + "connection_args": DEFAULT_CONNECTION_ARGS, "consistency_level": "Session", "index_params": None, "search_params": None, @@ -78,6 +77,6 @@ def test_to_and_from_dict(self, document_store: MilvusDocumentStore): assert document_store_dict == expected_dict reconstructed_document_store = MilvusDocumentStore.from_dict(document_store_dict) for field in vars(reconstructed_document_store): - if field.startswith("__"): + if field.startswith("__") or field == "alias": continue assert getattr(reconstructed_document_store, field) == getattr(document_store, field) diff --git a/tests/test_embedding_retriever.py b/tests/test_embedding_retriever.py index f41b482..c4fa0d7 100644 --- a/tests/test_embedding_retriever.py +++ b/tests/test_embedding_retriever.py @@ -8,18 +8,17 @@ logger = logging.getLogger(__name__) +DEFAULT_CONNECTION_ARGS = { + "uri": "http://localhost:19530", + # "uri": "./milvus_test.db", # This uri works for Milvus Lite +} + class TestMilvusEmbeddingTests: @pytest.fixture def document_store(self) -> MilvusDocumentStore: return MilvusDocumentStore( - connection_args={ - "host": "localhost", - "port": "19530", - "user": "", - "password": "", - "secure": False, - }, + connection_args=DEFAULT_CONNECTION_ARGS, drop_old=True, ) @@ -52,7 +51,7 @@ def test_to_dict(self, document_store: MilvusDocumentStore): "collection_name": "HaystackCollection", "collection_description": "", "collection_properties": None, - "connection_args": {"host": "localhost", "port": "19530", "user": "", "password": "", "secure": False}, + "connection_args": DEFAULT_CONNECTION_ARGS, "consistency_level": "Session", "index_params": None, "search_params": None, @@ -82,13 +81,7 @@ def test_from_dict(self, document_store: MilvusDocumentStore): "collection_name": "HaystackCollection", "collection_description": "", "collection_properties": None, - "connection_args": { - "host": "localhost", - "port": "19530", - "user": "", - "password": "", - "secure": False, - }, + "connection_args": DEFAULT_CONNECTION_ARGS, "consistency_level": "Session", "index_params": None, "search_params": None, @@ -115,7 +108,7 @@ def test_from_dict(self, document_store: MilvusDocumentStore): continue elif field == "document_store": for doc_store_field in vars(document_store): - if doc_store_field.startswith("__"): + if doc_store_field.startswith("__") or doc_store_field == "alias": continue assert getattr(reconstructed_retriever.document_store, doc_store_field) == getattr( document_store, doc_store_field