Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: entity_is_sparse_matrix: each row should be dict or list #2309

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pymilvus/client/entity_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pymilvus/client/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]

Expand Down