Skip to content

Commit

Permalink
fix coding style
Browse files Browse the repository at this point in the history
Signed-off-by: yangxuan <xuan.yang@zilliz.com>
  • Loading branch information
XuanYang-cn committed Nov 18, 2024
1 parent 5aa7dc9 commit 02bbf1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pymilvus/client/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@


def validate_strs(**kwargs):
""" validate if all values are legal non-emtpy str """
"""validate if all values are legal non-emtpy str"""
invalid_pair = {k: v for k, v in kwargs.items() if not validate_str(v)}
if invalid_pair:
msg = f"Illegal str variables: {invalid_pair}, expect non-empty str"
raise ParamError(message=msg)


def validate_nullable_strs(**kwargs):
""" validate if all values are either None or legal non-empty str """
"""validate if all values are either None or legal non-empty str"""
invalid_pair = {k: v for k, v in kwargs.items() if v is not None and not validate_str(v)}
if invalid_pair:
msg = f"Illegal nullable str variables: {invalid_pair}, expect None or non-empty str"
raise ParamError(message=msg)


def validate_str(var: Any) -> bool:
""" check if a variable is legal non-empty str """
"""check if a variable is legal non-empty str"""
return var and isinstance(var, str)


Expand Down

0 comments on commit 02bbf1d

Please sign in to comment.