From f46ffe7b50b329225d116513dfab926c4ad22a6d Mon Sep 17 00:00:00 2001 From: "junjie.jiang" Date: Tue, 17 Jan 2023 11:19:48 +0800 Subject: [PATCH] update Signed-off-by: junjie.jiang --- milvus_client.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/milvus_client.py b/milvus_client.py index e34f514..9a0d394 100644 --- a/milvus_client.py +++ b/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):