partners[milvus]: fix issue when metadata_schema is None (#25836)

fix issue when metadata_schema is None

Signed-off-by: ChengZi <chen.zhang@zilliz.com>
This commit is contained in:
ChengZi 2024-08-29 22:11:09 +08:00 committed by GitHub
parent 426333ff6f
commit 37f5ba416e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -475,7 +475,8 @@ class Milvus(VectorStore):
raise ValueError(f"Metadata key {key} is reserved.")
# Infer the corresponding datatype of the metadata
if (
key in self.metadata_schema # type: ignore
self.metadata_schema
and key in self.metadata_schema # type: ignore
and "dtype" in self.metadata_schema[key] # type: ignore
):
kwargs = self.metadata_schema[key].get("kwargs", {}) # type: ignore