From f9dbabcd164ad46edbbcaab042b8d07815c9625d Mon Sep 17 00:00:00 2001 From: XuanYang-cn Date: Wed, 24 Jan 2024 10:46:54 +0800 Subject: [PATCH] Multi-cherry bug fixes from master (#1890) fix: to avoid zero value for width (#1855) fix: change confusing error message (#1881) Signed-off-by: yangxuan Co-authored-by: MrPresent-Han <116052805+MrPresent-Han@users.noreply.github.com> Co-authored-by: lixinguo Co-authored-by: MrPresent-Han --- pymilvus/exceptions.py | 4 +++- pymilvus/orm/iterator.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pymilvus/exceptions.py b/pymilvus/exceptions.py index 28e8c9a83..948e35a8f 100644 --- a/pymilvus/exceptions.py +++ b/pymilvus/exceptions.py @@ -191,7 +191,9 @@ class ExceptionsMessage: PartitionKeyFieldType = "Param partition_key_field must be str type." PartitionKeyFieldNotExist = "the specified partition key field {%s} not exist" IsPartitionKeyType = "Param is_partition_key must be bool type." - DataTypeInconsistent = "The data in the same column must be of the same type." + DataTypeInconsistent = ( + "The Input data type is inconsistent with defined schema, please check it." + ) DataTypeNotSupport = "Data type is not support." DataLengthsInconsistent = "Arrays must all be same length." DataFrameInvalid = "Cannot infer schema from empty dataframe." diff --git a/pymilvus/orm/iterator.py b/pymilvus/orm/iterator.py index 4b7675bd4..50db692b4 100644 --- a/pymilvus/orm/iterator.py +++ b/pymilvus/orm/iterator.py @@ -344,6 +344,9 @@ def __update_width(self, page: SearchPage): self._width = last_hit.distance - first_hit.distance else: self._width = first_hit.distance - last_hit.distance + if self._width == 0.0: + self._width = 0.05 + # enable a minimum value for width to avoid radius and range_filter equal error def __set_up_range_parameters(self, page: SearchPage): self.__update_width(page)