logo
Browse Source

update

Signed-off-by: junjie.jiang <junjie.jiang@zilliz.com>
main
junjie.jiang 2 years ago
parent
commit
f46ffe7b50
  1. 9
      milvus_client.py

9
milvus_client.py

@ -22,7 +22,7 @@ class MilvusClient(PyOperator):
def __call__(self, *data):
"""
Insert data to Milvus.
Insert one row to Milvus.
Args:
data (`list`):
@ -34,7 +34,10 @@ class MilvusClient(PyOperator):
"""
row = []
for item in data:
row.append([item])
if isinstance(item, list):
row.extend([[i] for i in item])
else:
row.append([item])
mr = self._collection.insert(row)
if mr.err_count > 0:
raise RuntimeError("Insert to milvus failed")
@ -42,7 +45,7 @@ class MilvusClient(PyOperator):
@property
def shared_type(self):
return SharedType.Shareable
return SharedType.Shareable
def __del__(self):
if connections.has_connection(self._connect_name):

Loading…
Cancel
Save