Skip to content

Commit

Permalink
Corrected grammar and consistency in error messages (#2289) (#2330)
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.

Signed-off-by: zhenshan.cao <[email protected]>
Co-authored-by: Ahmet Yasin Aytar <[email protected]>
  • Loading branch information
czs007 and Ahmetyasin authored Nov 7, 2024
1 parent fadc01b commit c87b21c
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 @@ -477,7 +477,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 @@ -486,7 +486,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 @@ -499,7 +499,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 c87b21c

Please sign in to comment.