Browse Source
update
Signed-off-by: junjie.jiang <junjie.jiang@zilliz.com>
main
1 changed files with
4 additions and
1 deletions
-
milvus_client.py
|
|
@ -20,7 +20,7 @@ class MilvusClient(PyOperator): |
|
|
|
connections.connect(alias=self._connect_name, host=self._host, port=self._port) |
|
|
|
self._collection = Collection(self._collection_name, using=self._connect_name) |
|
|
|
|
|
|
|
def __call__(self, *row): |
|
|
|
def __call__(self, *data): |
|
|
|
""" |
|
|
|
Insert data to Milvus. |
|
|
|
|
|
|
@ -32,6 +32,9 @@ class MilvusClient(PyOperator): |
|
|
|
A MutationResult object contains `insert_count` represents how many and a `primary_keys` of primary keys. |
|
|
|
|
|
|
|
""" |
|
|
|
row = [] |
|
|
|
for item in data: |
|
|
|
row.append([item]) |
|
|
|
mr = self._collection.insert(row) |
|
|
|
if mr.err_count > 0: |
|
|
|
raise RuntimeError("Insert to milvus failed") |
|
|
|