From 3c5c787ea12c7d69c974c19f7dabe381a3604717 Mon Sep 17 00:00:00 2001 From: "junjie.jiang" Date: Thu, 15 Dec 2022 17:38:33 +0800 Subject: [PATCH] update Signed-off-by: junjie.jiang --- milvus_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/milvus_client.py b/milvus_client.py index e8dec0b..0647991 100644 --- a/milvus_client.py +++ b/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")