Skip to content

Commit 083fe67

Browse files
adding repo config
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent 81bd84a commit 083fe67

File tree

3 files changed

+15
-25
lines changed

3 files changed

+15
-25
lines changed

docs/how-to-guides/customizing-feast/adding-support-for-a-new-online-store.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ OnlineStore class names must end with the OnlineStore suffix!
2525

2626
### Contrib online stores
2727

28-
New online stores go in `sdk/python/feast/infra/online_stores/contrib/`.
28+
New online stores go in `sdk/python/feast/infra/online_stores/`.
2929

3030
#### What is a contrib plugin?
3131

sdk/python/feast/infra/online_stores/milvus_online_store/milvus.py

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,19 @@
3131

3232

3333
class MilvusOnlineStoreConfig(FeastConfigBaseModel, VectorStoreConfig):
34-
"""Online store config for Milvus vector database"""
35-
36-
type: Literal["milvus", "feast.infra.online_stores.milvus.MilvusOnlineStore"] = (
37-
"milvus"
38-
)
39-
"""Online store type selector"""
40-
41-
host: StrictStr = "localhost"
42-
"""Hostname for Milvus server"""
43-
44-
port: int = 19530
45-
"""Port for Milvus server"""
46-
47-
index_type: str = "IVF_FLAT"
48-
"""Index type for Milvus collection"""
49-
50-
metric_type: str = "L2"
51-
"""Distance metric type"""
34+
"""
35+
Configuration for the Milvus online store.
36+
NOTE: The class *must* end with the `OnlineStoreConfig` suffix.
37+
"""
5238

53-
embedding_dim: int = 128
54-
"""Dimension of the embedding vectors"""
39+
type: Literal["milvus"] = "milvus"
5540

56-
vector_enabled: bool = True
57-
"""Flag to enable vector search"""
41+
host: Optional[StrictStr] = "localhost"
42+
port: Optional[int] = 19530
43+
index_type: Optional[str] = "IVF_FLAT"
44+
metric_type: Optional[str] = "L2"
45+
embedding_dim: Optional[int] = 128
46+
vector_enabled: Optional[bool] = True
5847

5948

6049
class MilvusOnlineStore(OnlineStore):
@@ -69,7 +58,7 @@ class MilvusOnlineStore(OnlineStore):
6958

7059
def _connect(self, config: RepoConfig):
7160
connections.connect(
72-
alias="default",
61+
alias="feast",
7362
host=config.online_store.host,
7463
port=str(config.online_store.port),
7564
)
@@ -350,7 +339,7 @@ def __init__(self, host: str, port: int, name: str):
350339
self._connect()
351340

352341
def _connect(self):
353-
connections.connect(alias="default", host=self.host, port=str(self.port))
342+
return connections.connect(alias="default", host=self.host, port=str(self.port))
354343

355344
def to_infra_object_proto(self) -> InfraObjectProto:
356345
# Implement serialization if needed

sdk/python/feast/repo_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"singlestore": "feast.infra.online_stores.singlestore_online_store.singlestore.SingleStoreOnlineStore",
8282
"qdrant": "feast.infra.online_stores.cqdrant.QdrantOnlineStore",
8383
"couchbase": "feast.infra.online_stores.couchbase_online_store.couchbase.CouchbaseOnlineStore",
84+
"milvus": "feast.infra.online_stores.milvus_online_store.milvus.MilvusOnlineStore",
8485
**LEGACY_ONLINE_STORE_CLASS_FOR_TYPE,
8586
}
8687

0 commit comments

Comments
 (0)