From a9f91e67331bce8f14893c532304fa02522f9950 Mon Sep 17 00:00:00 2001 From: bigsheeper Date: Thu, 11 Apr 2024 15:57:36 +0800 Subject: [PATCH] fix: Fix import array via bulkwriter Signed-off-by: bigsheeper --- pymilvus/bulk_writer/buffer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pymilvus/bulk_writer/buffer.py b/pymilvus/bulk_writer/buffer.py index 12c971d4e..e77723777 100644 --- a/pymilvus/bulk_writer/buffer.py +++ b/pymilvus/bulk_writer/buffer.py @@ -212,6 +212,12 @@ def _persist_parquet(self, local_path: str, **kwargs): for val in self._buffer[k]: arr.append(np.array(val, dtype=np.dtype("uint8"))) data[k] = pd.Series(arr) + elif field_schema.dtype == DataType.ARRAY: + dt = NUMPY_TYPE_CREATOR[field_schema.element_type.name] + arr = [] + for val in self._buffer[k]: + arr.append(np.array(val, dtype=dt)) + data[k] = pd.Series(arr) elif field_schema.dtype.name in NUMPY_TYPE_CREATOR: dt = NUMPY_TYPE_CREATOR[field_schema.dtype.name] data[k] = pd.Series(self._buffer[k], dtype=dt)