Skip to content

Commit

Permalink
refactor: add adjacency to doc pb definiton
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Sep 1, 2020
1 parent 27c3caf commit 85643ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jina/drivers/__init__.py
Expand Up @@ -279,13 +279,13 @@ def post_traverse(_docs, traverse_on, context_doc=None):
self._apply(d, context_doc, traverse_on, *args, **kwargs)

# check first doc if in the required depth range
if self._is_apply_all and _docs[0].granularity >= self._depth_start:
if self._is_apply_all and getattr(_docs[0], depth_name) >= self._depth_start:
self._apply_all(_docs, context_doc, traverse_on, *args, **kwargs)

def pre_traverse(_docs, traverse_on, context_doc=None):
if _docs:
# check first doc if in the required depth range
if self._is_apply_all and _docs[0].granularity >= self._depth_start:
if self._is_apply_all and getattr(_docs[0], depth_name) >= self._depth_start:
self._apply_all(_docs, context_doc, traverse_on, *args, **kwargs)

for d in _docs:
Expand Down

0 comments on commit 85643ef

Please sign in to comment.