milvus-io / pymilvus

Python SDK for Milvus.
Apache License 2.0
982 stars 312 forks source link

[Enhancement]: `infer_dtype_bydata` can not infer DataType.ARRAY #2165

Open zc277584121 opened 2 months ago

zc277584121 commented 2 months ago

Is there an existing issue for this?

What would you like to be added?

img_v3_02cd_b8dc5f62-0f18-47cb-89a3-8014d7ade12g I have tried some examples, and infer_dtype_bydata can not infer DataType.ARRAY from any type of array-like data. Maybe pymilvus should offer a function to infer a ARRAY datatype, as well as the element type within the array.

Why is this needed?

Because someone want to use this function to infer ARRAY type from metadata in Langchain. https://github.com/langchain-ai/langchain/pull/23219/files#diff-e5632024b6ba1822184894603c61d3abe15be32464c94feaf805e4af6061730cR419 In the past, we can use infer_dtype_bydata to infer any types such as FLOAT_VECTOR. However, this failed when infering ARRAY data

Anything else?

No response

zc277584121 commented 2 months ago

This issue is similar to https://github.com/milvus-io/pymilvus/issues/1785

rgupta2508 commented 2 months ago

Added PR to resolve this https://github.com/milvus-io/pymilvus/pull/2144

Please review

rgupta2508 commented 2 months ago

For int array also it will return datatype as FLOAT_VECTOR, for float array also same issue

rgupta2508 commented 1 month ago

https://github.com/milvus-io/pymilvus/issues/1785