From 7ac3f80ca839e93ec4b93f6c119e3befcd784b3b Mon Sep 17 00:00:00 2001 From: yah01 Date: Tue, 16 May 2023 16:45:54 +0800 Subject: [PATCH] Fix failed to calculate the length of JSON data Signed-off-by: yah01 --- pymilvus/client/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pymilvus/client/utils.py b/pymilvus/client/utils.py index a528bc7cd..d0726d8d6 100644 --- a/pymilvus/client/utils.py +++ b/pymilvus/client/utils.py @@ -131,6 +131,9 @@ def len_of(field_data) -> int: if field_data.scalars.HasField("bytes_data"): return len(field_data.scalars.bytes_data.data) + if field_data.scalars.HasField("json_data"): + return len(field_data.scalars.json_data.data) + raise MilvusException(message="Unsupported scalar type") if field_data.HasField("vectors"):