From 9075512bb91b97dea74c853dbf57d52b7bb3760d Mon Sep 17 00:00:00 2001 From: MrPresent-Han <116052805+MrPresent-Han@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:36:17 +0800 Subject: [PATCH] adjust metrics comparison (#1798) Signed-off-by: MrPresent-Han --- pymilvus/orm/iterator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymilvus/orm/iterator.py b/pymilvus/orm/iterator.py index 918d94bbc..bdc395e44 100644 --- a/pymilvus/orm/iterator.py +++ b/pymilvus/orm/iterator.py @@ -203,9 +203,9 @@ def close(self) -> None: def metrics_positive_related(metrics: str) -> bool: if metrics in [CALC_DIST_L2, CALC_DIST_JACCARD, CALC_DIST_HAMMING, CALC_DIST_TANIMOTO]: return True - if metrics is CALC_DIST_IP or metrics is CALC_DIST_COSINE: + if metrics in [CALC_DIST_IP, CALC_DIST_COSINE]: return False - raise MilvusException(message=f"unsupported metrics type for search iteration{metrics}") + raise MilvusException(message=f"unsupported metrics type for search iteration: {metrics}") class SearchPage(LoopBase):