langchain/libs/partners/milvus/tests
Stuart Marsh 16bd0697dc
milvus: fixed bug when using partition key and dynamic fields together (#25028)
**Description:**

This PR fixes a bug where if `enable_dynamic_field` and
`partition_key_field` are enabled at the same time, a pymilvus error
occurs.

Milvus requires the partition key field to be a full schema defined
field, and not a dynamic one, so it will throw the error "the specified
partition key field {field} not exist" when creating the collection.

When `enabled_dynamic_field` is set to `True`, all schema field creation
based on `metadatas` is skipped. This code now checks if
`partition_key_field` is set, and creates the field.

Integration test added.

**Twitter handle:** StuartMarshUK

---------

Co-authored-by: Stuart Marsh <stuart.marsh@qumata.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-08-05 16:01:55 +00:00
..
integration_tests milvus: fixed bug when using partition key and dynamic fields together (#25028) 2024-08-05 16:01:55 +00:00
unit_tests milvus: New langchain_milvus package and new milvus features (#21077) 2024-05-28 08:24:20 -07:00
__init__.py milvus: New langchain_milvus package and new milvus features (#21077) 2024-05-28 08:24:20 -07:00