Skip to content

Commit

Permalink
fix(driver): fix slicing remove logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Jul 22, 2020
1 parent 8546370 commit 727066d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jina/drivers/querylang/slice.py
Expand Up @@ -33,17 +33,18 @@ def apply_all(self, docs: Iterable['jina_pb2.Document'], *args, **kwargs):
if self.start <= 0 and (self.end is None or self.end >= len(docs)):
pass
else:
del docs[:self.start]
del docs[self.end:]
del docs[:self.start]



class SliceMatchesQL(SliceQL):
def apply(self, doc: 'jina_pb2.Document', *args, **kwargs):
if self.start <= 0 and (self.end is None or self.end >= len(doc.matches)):
pass
else:
del doc.matches[:self.start]
del doc.matches[self.end:]
del doc.matches[:self.start]

def apply_all(self, docs: Iterable['jina_pb2.Document'], *args, **kwargs):
pass

0 comments on commit 727066d

Please sign in to comment.