From 5c76734a5b876aed6887a41cda836c44338bab00 Mon Sep 17 00:00:00 2001 From: Xianhui Lin <35839735+JsDove@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:24:36 +0800 Subject: [PATCH] enhance: [2.5] createdatabase support properties (#2449) enhance createdatabase support properties issue: https://github.com/milvus-io/pymilvus/issues/2447 --------- Signed-off-by: Xianhui.Lin --- pymilvus/client/grpc_handler.py | 10 ++++++++-- pymilvus/milvus_client/milvus_client.py | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pymilvus/client/grpc_handler.py b/pymilvus/client/grpc_handler.py index c2166b46b..57302cc1d 100644 --- a/pymilvus/client/grpc_handler.py +++ b/pymilvus/client/grpc_handler.py @@ -1359,8 +1359,14 @@ def get_loading_progress( return response.progress @retry_on_rpc_failure() - def create_database(self, db_name: str, timeout: Optional[float] = None, **kwargs): - request = Prepare.create_database_req(db_name, **kwargs) + def create_database( + self, + db_name: str, + properties: Optional[dict] = None, + timeout: Optional[float] = None, + **kwargs, + ): + request = Prepare.create_database_req(db_name, properties=properties, **kwargs) status = self._stub.CreateDatabase(request, timeout=timeout) check_status(status) diff --git a/pymilvus/milvus_client/milvus_client.py b/pymilvus/milvus_client/milvus_client.py index 563b94cde..f80e2e396 100644 --- a/pymilvus/milvus_client/milvus_client.py +++ b/pymilvus/milvus_client/milvus_client.py @@ -1167,9 +1167,9 @@ def using_database(self, db_name: str, **kwargs): conn = self._get_connection() conn.reset_db_name(db_name) - def create_database(self, db_name: str, **kwargs): + def create_database(self, db_name: str, properties: Optional[dict] = None, **kwargs): conn = self._get_connection() - conn.create_database(db_name, **kwargs) + conn.create_database(db_name, properties, **kwargs) def drop_database(self, db_name: str, **kwargs): conn = self._get_connection()