From f97a6ee89fc2870a42a116ec9d6ac367311f2844 Mon Sep 17 00:00:00 2001 From: Pandu Oliver Kerr Date: Wed, 9 Nov 2022 19:25:11 +1100 Subject: [PATCH] minor changes --- src/marqo/tensor_search/tensor_search.py | 2 +- tests/tensor_search/test_add_documents.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/marqo/tensor_search/tensor_search.py b/src/marqo/tensor_search/tensor_search.py index 5c2d7f990..f93fc7be6 100644 --- a/src/marqo/tensor_search/tensor_search.py +++ b/src/marqo/tensor_search/tensor_search.py @@ -259,7 +259,7 @@ def add_documents_orchestrator( def _batch_request(config: Config, index_name: str, dataset: List[dict], batch_size: int = 100, verbose: bool = True, device=None, - update_mode: str = 'replace', non_tensor_fields = []) -> List[Dict[str, Any]]: + update_mode: str = 'replace', non_tensor_fields: List[str] = []) -> List[Dict[str, Any]]: """Batch by the number of documents""" logger.info(f"starting batch ingestion in sizes of {batch_size}") diff --git a/tests/tensor_search/test_add_documents.py b/tests/tensor_search/test_add_documents.py index f8554e288..230f88248 100644 --- a/tests/tensor_search/test_add_documents.py +++ b/tests/tensor_search/test_add_documents.py @@ -11,6 +11,7 @@ from marqo.errors import IndexNotFoundError, InvalidArgError, BadRequestError from marqo.tensor_search import tensor_search, index_meta_cache, backend from tests.marqo_test import MarqoTestCase +import time class TestAddDocuments(MarqoTestCase): @@ -24,6 +25,14 @@ def setUp(self) -> None: except IndexNotFoundError as s: pass + def tearDown(self) -> None: + self.index_name_1 = "my-test-index-1" + try: + tensor_search.delete_index(config=self.config, index_name=self.index_name_1) + except IndexNotFoundError as s: + pass + + def _match_all(self, index_name, verbose=True): """Helper function""" res = requests.get( @@ -876,7 +885,7 @@ def test_put_documents_orchestrator(self): {"_id": "789", "Temp": 12.5}, ], auto_refresh=True, update_mode='update', processes=4, batch_size=1) - + time.sleep(3) updated_doc = tensor_search.get_document_by_id( config=self.config, index_name=self.index_name_1, document_id='789' )