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):