Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pandu-k committed Nov 9, 2022
1 parent da7a581 commit f97a6ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/marqo/tensor_search/tensor_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down
11 changes: 10 additions & 1 deletion tests/tensor_search/test_add_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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(
Expand Down Expand Up @@ -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'
)
Expand Down

0 comments on commit f97a6ee

Please sign in to comment.