[skip ci] Fix mishards query result reduce error (#3256)

Signed-off-by: yinghao.zou <yinghao.zou@zilliz.com>
pull/3267/head
BossZou 2020-08-14 15:37:01 +08:00 committed by GitHub
parent 43c272fd13
commit 8a239355e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -27,7 +27,8 @@ class ServiceHandler(milvus_pb2_grpc.MilvusServiceServicer):
self.max_workers = max_workers
def _reduce(self, source_ids, ids, source_diss, diss, k, reverse):
sort_f = lambda x, y: x >= y if reverse else lambda x, y: x <= y
sort_f = (lambda x, y: x >= y) if reverse else (lambda x, y: x <= y)
if sort_f(source_diss[k - 1], diss[0]):
return source_ids, source_diss
if sort_f(diss[k - 1], source_diss[0]):