Skip to content

Commit 64acef6

Browse files
authored
fix: Fix import array via bulkwriter (#2035) (#2036)
When import via bulkwriter, for array type, we should specify datatype; otherwise, it will default to double(for float32 array) and int64(for int8, int16, int32 array). issue: #2034, milvus-io/milvus#31834 pr: #2035 Signed-off-by: bigsheeper <[email protected]>
1 parent 7d75517 commit 64acef6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎pymilvus/bulk_writer/buffer.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ def _persist_parquet(self, local_path: str, **kwargs):
212212
for val in self._buffer[k]:
213213
arr.append(np.array(val, dtype=np.dtype("uint8")))
214214
data[k] = pd.Series(arr)
215+
elif field_schema.dtype == DataType.ARRAY:
216+
dt = NUMPY_TYPE_CREATOR[field_schema.element_type.name]
217+
arr = []
218+
for val in self._buffer[k]:
219+
arr.append(np.array(val, dtype=dt))
220+
data[k] = pd.Series(arr)
215221
elif field_schema.dtype.name in NUMPY_TYPE_CREATOR:
216222
dt = NUMPY_TYPE_CREATOR[field_schema.dtype.name]
217223
data[k] = pd.Series(self._buffer[k], dtype=dt)

0 commit comments

Comments
 (0)