Skip to content

Commit 036005d

Browse files
Fix function construct bug
Signed-off-by: junjiejiangjjj <[email protected]>
1 parent fb36fa6 commit 036005d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pymilvus/orm/schema.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -569,12 +569,12 @@ def __init__(
569569
params: Optional[Dict] = None,
570570
):
571571
if not isinstance(name, str):
572-
raise ParamError(message="The name of the function should be a string.")
572+
raise ParamError(message="The name of the function should be a string, but got {}".format(type(name)))
573573
if not isinstance(description, str):
574-
raise ParamError(message="The description of the function should be a string.")
574+
raise ParamError(message="The description of the function should be a string, but got {}".format(type(description)))
575575
if not isinstance(input_field_names, (str, list)):
576576
raise ParamError(
577-
message="The input field names of the function should be a string or a list of strings."
577+
message="The input field names of the function should be a string or a list of strings, but got {}".format(type(input_field_names))
578578
)
579579
self._name = name
580580
self._description = description
@@ -585,7 +585,7 @@ def __init__(
585585
output_field_names = []
586586
if not isinstance(output_field_names, (str, list)):
587587
raise ParamError(
588-
message="The output field names of the function should be a string or a list of strings."
588+
message="The output field names of the function should be a string or a list of strings, but got {}".format(type(output_field_names))
589589
)
590590
output_field_names = (
591591
[output_field_names] if isinstance(output_field_names, str) else output_field_names
@@ -684,8 +684,8 @@ def construct_from_dict(cls, raw: Dict):
684684
return Function(
685685
raw["name"],
686686
raw["type"],
687-
raw["input_field_names"],
688-
raw["output_field_names"],
687+
list(raw["input_field_names"]),
688+
list(raw["output_field_names"]),
689689
raw["description"],
690690
raw["params"],
691691
)

0 commit comments

Comments
 (0)