diff --git a/pymilvus/client/entity_helper.py b/pymilvus/client/entity_helper.py index 3e808d2a0..d66324610 100644 --- a/pymilvus/client/entity_helper.py +++ b/pymilvus/client/entity_helper.py @@ -46,6 +46,8 @@ def is_float_type(v: Any): for item in entity: if SciPyHelper.is_scipy_sparse(item): return item.shape[0] == 1 + if not isinstance(item, dict) and not isinstance(item, list): + return False pairs = item.items() if isinstance(item, dict) else item # each row must be a list of Tuple[int, float]. we allow empty sparse row for pair in pairs: diff --git a/pymilvus/client/prepare.py b/pymilvus/client/prepare.py index 70f9f1770..c4aae9fc5 100644 --- a/pymilvus/client/prepare.py +++ b/pymilvus/client/prepare.py @@ -512,7 +512,7 @@ def _parse_upsert_row_request( ): field_data.valid_data.append(v is not None) entity_helper.pack_field_value_to_field_data(v, field_data, field_info) - for field in fields_info: + for field in input_fields_info: key = field["name"] if key in entity: continue @@ -538,7 +538,7 @@ def _parse_upsert_row_request( request.fields_data.extend(fields_data.values()) - for _, field in enumerate(fields_info): + for _, field in enumerate(input_fields_info): is_dynamic = False field_name = field["name"]