Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianmtr committed Jan 15, 2021
1 parent bcd91bc commit 317124c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
3 changes: 0 additions & 3 deletions jina/drivers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ def _apply_all(self, docs: 'DocumentSet', *args, **kwargs) -> None:
self.logger.warning(f'these bad docs can not be added: {bad_docs}')
idx, dist = self.exec_fn(embed_vecs, top_k=int(self.top_k))

if idx is None and dist is None:
return

op_name = self.exec.__class__.__name__
# can be None if index is size 0
if idx is not None and dist is not None:
Expand Down
13 changes: 3 additions & 10 deletions tests/integration/docidcache/test_crud_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
VEC_IDX_FILENAME = 'vec_idx.bin'
DOCS_TO_SEARCH = 1
TOP_K = 5
BATCH_SIZE = 4
REQUEST_SIZE = 4
DOCS_TO_INDEX = 10

pytest.register_assert_rewrite('check_indexers_size')


def config_env(field, tmp_workspace, shards, indexers, polling):
os.environ['JINA_SHARDS'] = str(shards)
Expand Down Expand Up @@ -71,11 +69,6 @@ def get_documents(chunks, same_content, nr=10, index_start=0):
yield d


docs_chunks = [0, 3, 5]
docs_same_content = [False, True]
docs_nr = [0, 10, 100]


def get_index_flow(field, tmp_path, shards, indexers):
config_env(field, tmp_path, shards, indexers, polling='any')
f = Flow.load_config(os.path.join(os.curdir, 'crud_cache_flow_index.yml'))
Expand Down Expand Up @@ -245,7 +238,7 @@ def validate_results(resp):

# INDEX
with flow_index as f:
f.index(docs, batch_size=BATCH_SIZE)
f.index(docs, request_size=REQUEST_SIZE)

check_indexers_size(chunks, len(docs), field, tmp_path, same_content, shards, 'index')

Expand All @@ -255,7 +248,7 @@ def validate_results(resp):

new_docs = list(get_documents(chunks=chunks, same_content=same_content, index_start=index_start_new_docs))
with flow_index as f:
f.index(new_docs, batch_size=BATCH_SIZE)
f.index(new_docs, request_size=REQUEST_SIZE)

check_indexers_size(chunks, len(docs), field, tmp_path, same_content, shards, 'index2')

Expand Down

0 comments on commit 317124c

Please sign in to comment.