Skip to content

Commit

Permalink
fix: bulkwriter to skip function output fields (milvus-io#2319)
Browse files Browse the repository at this point in the history
milvus-io/milvus#37196

Signed-off-by: Buqian Zheng <[email protected]>
Signed-off-by: NamCaoHai <[email protected]>
  • Loading branch information
zhengbuqian authored and CaoHaiNam committed Nov 7, 2024
1 parent c69dde7 commit 4a74c96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pymilvus/bulk_writer/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def __init__(
for field in schema.fields:
if field.is_primary and field.auto_id:
continue
if field.is_function_output:
continue
self._buffer[field.name] = []
self._fields[field.name] = field

Expand Down
5 changes: 5 additions & 0 deletions pymilvus/bulk_writer/bulk_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ def _verify_row(self, row: dict):
)
else:
continue
if field.is_function_output:
if field.name in row:
self._throw(f"Field '{field.name}' is function output, no need to provide")
else:
continue

if field.name not in row:
self._throw(f"The field '{field.name}' is missed in the row")
Expand Down

0 comments on commit 4a74c96

Please sign in to comment.