Skip to content

Commit

Permalink
Corrected grammar and consistency in error messages (#2289)
Browse files Browse the repository at this point in the history
This PR updates several error messages for grammar and clarity. The
changes include:

Corrected "data should be a list of list" to "The data should be a list
of lists" for better readability.
Fixed grammar in "The data don't match with schema fields" to "The data
doesn't match with schema fields."
Corrected field name mismatch message from "The name of field don't
match" to "The name of the field doesn't match."
These improvements enhance the clarity and professionalism of error
messages in the codebase.
  • Loading branch information
Ahmetyasin authored Nov 6, 2024
1 parent 23ca4e3 commit 650f7cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pymilvus/orm/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def _check_insert_data(data: Union[List[List], pd.DataFrame]):
is_dataframe = isinstance(data, pd.DataFrame)
for col in data:
if not is_dataframe and not is_list_like(col):
raise DataTypeNotSupportException(message="data should be a list of list")
raise DataTypeNotSupportException(message="The data should be a list of list")


def _check_data_schema_cnt(fields: List, data: Union[List[List], pd.DataFrame]):
Expand All @@ -716,7 +716,7 @@ def _check_data_schema_cnt(fields: List, data: Union[List[List], pd.DataFrame]):
data_cnt = len(data.columns) if is_dataframe else len(data)
if field_cnt != data_cnt:
message = (
f"The data don't match with schema fields, expect {field_cnt} list, got {len(data)}"
f"The data doesn't match with schema fields, expect {field_cnt} list, got {len(data)}"
)
if is_dataframe:
i_name = [f.name for f in fields]
Expand All @@ -729,7 +729,7 @@ def _check_data_schema_cnt(fields: List, data: Union[List[List], pd.DataFrame]):
for x, y in zip(list(data.columns), fields):
if x != y.name:
raise DataNotMatchException(
message=f"The name of field don't match, expected: {y.name}, got {x}"
message=f"The name of field doesn't match, expected: {y.name}, got {x}"
)


Expand Down

0 comments on commit 650f7cd

Please sign in to comment.