Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Updating Milvus Online Store implementation to use Milvus lite for local mode #4911

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,16 @@ class MilvusOnlineStore(OnlineStore):

def _connect(self, config: RepoConfig) -> MilvusClient:
if not self.client:
self.client = MilvusClient(
url=f"{config.online_store.host}:{config.online_store.port}",
token=f"{config.online_store.username}:{config.online_store.password}"
if config.online_store.username and config.online_store.password
else "",
)
if config.provider == "local":
print("Connecting to Milvus in local mode using ./milvus_demo.db")
self.client = MilvusClient("./milvus_demo.db")
else:
self.client = MilvusClient(
url=f"{config.online_store.host}:{config.online_store.port}",
token=f"{config.online_store.username}:{config.online_store.password}"
if config.online_store.username and config.online_store.password
else "",
)
return self.client

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

self.client.insert(
collection_name=collection["collection_name"], data=entity_batch_to_insert
collection_name=collection["collection_name"],
data=entity_batch_to_insert,
)

def online_read(
Expand Down
Loading