Skip to content

Commit 4b19024

Browse files
chore: Updating Milvus Online Store implementation to use Milvus lite for local mode (feast-dev#4911)
* chore: Updating workflow to use custom version for get highest semver step Signed-off-by: Francisco Javier Arceo <[email protected]> * removing print statements Signed-off-by: Francisco Javier Arceo <[email protected]> * removing feature_store.yaml and test_workflow.py Signed-off-by: Francisco Javier Arceo <[email protected]> --------- Signed-off-by: Francisco Javier Arceo <[email protected]>
1 parent 1d47cb6 commit 4b19024

File tree

1 file changed

+12
-7
lines changed
  • sdk/python/feast/infra/online_stores/milvus_online_store

1 file changed

+12
-7
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,16 @@ class MilvusOnlineStore(OnlineStore):
108108

109109
def _connect(self, config: RepoConfig) -> MilvusClient:
110110
if not self.client:
111-
self.client = MilvusClient(
112-
url=f"{config.online_store.host}:{config.online_store.port}",
113-
token=f"{config.online_store.username}:{config.online_store.password}"
114-
if config.online_store.username and config.online_store.password
115-
else "",
116-
)
111+
if config.provider == "local":
112+
print("Connecting to Milvus in local mode using ./milvus_demo.db")
113+
self.client = MilvusClient("./milvus_demo.db")
114+
else:
115+
self.client = MilvusClient(
116+
url=f"{config.online_store.host}:{config.online_store.port}",
117+
token=f"{config.online_store.username}:{config.online_store.password}"
118+
if config.online_store.username and config.online_store.password
119+
else "",
120+
)
117121
return self.client
118122

119123
def _get_collection(self, config: RepoConfig, table: FeatureView) -> Dict[str, Any]:
@@ -247,7 +251,8 @@ def online_write_batch(
247251
progress(1)
248252

249253
self.client.insert(
250-
collection_name=collection["collection_name"], data=entity_batch_to_insert
254+
collection_name=collection["collection_name"],
255+
data=entity_batch_to_insert,
251256
)
252257

253258
def online_read(

0 commit comments

Comments
 (0)