Skip to content

Commit

Permalink
fix: dir structure
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianmtr committed Jan 14, 2021
1 parent 6ae2d57 commit f79a765
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 27 deletions.
15 changes: 2 additions & 13 deletions jina/drivers/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

import time

from google.protobuf.json_format import MessageToJson

from . import BaseDriver
from .querylang.queryset.dunderkey import dunder_get
from ..excepts import UnknownControlCommand, RuntimeTerminated, NoExplicitMessage
Expand All @@ -24,26 +22,17 @@ def envelope(self) -> 'jina_pb2.EnvelopeProto':
class LogInfoDriver(BaseControlDriver):
"""Log output the request info"""

def __init__(self, key: str = 'request', json=False, *args, **kwargs):
def __init__(self, key: str = 'request', *args, **kwargs):
"""
:param key: (str) that represents a first level or nested key in the dict
:param args:
:param kwargs:
"""
super().__init__(*args, **kwargs)
self.key = key
self.json = json

def __call__(self, *args, **kwargs):
data = dunder_get(self.msg.as_pb_object, self.key)
if self.json:
self.logger.info(
MessageToJson(data)
)
else:
self.logger.info(
MessageToJson(data)
)
self.logger.info(dunder_get(self.msg.as_pb_object, self.key))


class WaitDriver(BaseControlDriver):
Expand Down
6 changes: 2 additions & 4 deletions jina/executors/indexers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,8 @@ def _get_indices_to_drop(self, keys: List, existent_keys: Iterator, check_path:
if key not in existent_keys:
indices_to_drop.append(key_index)
if indices_to_drop:
# TODO
pass
# self.logger.warning(
# f'Key(s) {[keys[i] for i in indices_to_drop]} were not found in {check_path}. Continuing anyway...')
self.logger.warning(
f'Key(s) {[keys[i] for i in indices_to_drop]} were not found in {check_path}. Continuing anyway...')
return indices_to_drop


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
!Flow
pods:
cache:
uses: yml/cache.yml
uses: cache.yml
show_exc_info: true
vector:
uses: yml/vector.yml
uses: vector.yml
shards: $JINA_SHARDS
separated_workspace: True
uses_after: '_merge_matches'
Expand All @@ -13,7 +13,7 @@ pods:
show_exc_info: true
needs: cache
kv:
uses: yml/kv.yml
uses: kv.yml
shards: $JINA_SHARDS
separated_workspace: True
uses_after: '_merge_matches'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
!Flow
pods:
vector:
uses: yml/vector.yml
uses: vector.yml
shards: $JINA_SHARDS
separated_workspace: True
uses_after: 'yml/_merge_matches_topk.yml'
uses_after: '_merge_matches_topk.yml'
polling: $JINA_POLLING
timeout_ready: '-1'
show_exc_info: true
kv:
uses: yml/kv.yml
uses: kv.yml
shards: $JINA_SHARDS
separated_workspace: True
uses_after: 'yml/_merge_matches_topk.yml'
uses_after: '_merge_matches_topk.yml'
polling: $JINA_POLLING
timeout_ready: '-1'
show_exc_info: true
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/integration/docidcache/test_crud_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@ def get_documents(chunks, same_content, nr=10, index_start=0):

def get_index_flow(field, tmp_path, shards, indexers):
config_env(field, tmp_path, shards, indexers, polling='any')
f = Flow.load_config(os.path.abspath('yml/crud_cache_flow_index.yml'))
f = Flow.load_config(os.path.join(os.curdir, 'crud_cache_flow_index.yml'))
return f


def get_query_flow(field, tmp_path, shards):
# searching must always be sequential
config_env(field, tmp_path, shards, 'sequential', polling='all')
f = Flow.load_config(os.path.abspath('yml/crud_cache_flow_query.yml'))
f = Flow.load_config(os.path.join(os.curdir, 'crud_cache_flow_query.yml'))
return f


def get_delete_flow(field, tmp_path, shards, indexers):
config_env(field, tmp_path, shards, indexers, polling='all')
f = Flow.load_config(os.path.abspath('yml/crud_cache_flow_index.yml'))
f = Flow.load_config(os.path.join(os.curdir, 'crud_cache_flow_index.yml'))
return f


Expand Down
File renamed without changes.

0 comments on commit f79a765

Please sign in to comment.