Skip to content

Commit

Permalink
fix check string max len. Otherwise it's impossible to insert string …
Browse files Browse the repository at this point in the history
…with len same as varchar max len. (milvus-io#1304)

Signed-off-by: Ievgen Zapolskyi <[email protected]>
  • Loading branch information
izapolsk authored and XuanYang-cn committed Mar 7, 2023
1 parent cfda018 commit 8ac6cd6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymilvus/client/entity_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ def check_str_arr(str_arr, max_len):
for s in str_arr:
if not isinstance(s, str):
raise ParamError(message=f"expect string input, got: {type(s)}")
if len(s) >= max_len:
raise ParamError(message=f"invalid input, length of string exceeds max length. length: {len(s)}, max length: {max_len}")
if len(s) > max_len:
raise ParamError(message=f"invalid input, length of string exceeds max length. length: {len(s)}, "
f"max length: {max_len}")


def entity_to_str_arr(entity, field_info, check=True):
Expand Down

0 comments on commit 8ac6cd6

Please sign in to comment.