From 11d0aa038f7a484d243fa1feb5a28af004bdbf95 Mon Sep 17 00:00:00 2001 From: Jiquan Long Date: Wed, 2 Aug 2023 17:07:00 +0800 Subject: [PATCH] Fix exception message (#1632) Signed-off-by: longjiquan --- pymilvus/client/grpc_handler.py | 4 +++- pymilvus/orm/constants.py | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pymilvus/client/grpc_handler.py b/pymilvus/client/grpc_handler.py index 7d71b3192..70e141eac 100644 --- a/pymilvus/client/grpc_handler.py +++ b/pymilvus/client/grpc_handler.py @@ -130,11 +130,13 @@ def _wait_for_channel_ready(self, timeout: Union[int, float] = 10): try: grpc.channel_ready_future(self._channel).result(timeout=timeout) self._setup_identifier_interceptor(self._user) - except (grpc.FutureTimeoutError, MilvusException) as e: + except grpc.FutureTimeoutError as e: raise MilvusException( code=Status.CONNECT_FAILED, message=f"Fail connecting to server on {self._address}. Timeout", ) from e + except Exception as e: + raise e from e def close(self): self._channel.close() diff --git a/pymilvus/orm/constants.py b/pymilvus/orm/constants.py index 56a894e56..08fb1a37c 100644 --- a/pymilvus/orm/constants.py +++ b/pymilvus/orm/constants.py @@ -35,10 +35,10 @@ RANGE_FILTER = "range_filter" FIELDS = "fields" ITERATION_EXTENSION_REDUCE_RATE = "iteration_extension_reduce_rate" -DEFAULT_MAX_L2_DISTANCE = float(99999999.0) -DEFAULT_MIN_IP_DISTANCE = float(-99999999.0) -DEFAULT_MAX_HAMMING_DISTANCE = float(99999999.0) -DEFAULT_MAX_TANIMOTO_DISTANCE = float(99999999.0) -DEFAULT_MAX_JACCARD_DISTANCE = float(2.0) -DEFAULT_MIN_COSINE_DISTANCE = float(-2.0) +DEFAULT_MAX_L2_DISTANCE = 99999999.0 +DEFAULT_MIN_IP_DISTANCE = -99999999.0 +DEFAULT_MAX_HAMMING_DISTANCE = 99999999.0 +DEFAULT_MAX_TANIMOTO_DISTANCE = 99999999.0 +DEFAULT_MAX_JACCARD_DISTANCE = 2.0 +DEFAULT_MIN_COSINE_DISTANCE = -2.0 MAX_FILTERED_IDS_COUNT_ITERATION = 100000