From c42dfcc8c0c67f07b886bdb1ba030c412782f3cf Mon Sep 17 00:00:00 2001 From: MrPresent-Han Date: Wed, 22 Nov 2023 18:06:56 +0800 Subject: [PATCH] adjust metrics comparison 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 5b77b931b..6a2e40a1b 100644 --- a/pymilvus/orm/iterator.py +++ b/pymilvus/orm/iterator.py @@ -200,9 +200,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):