From 364da8bde5511845c69dc0efa3d6f6068a433624 Mon Sep 17 00:00:00 2001 From: Xianhui Lin <35839735+JsDove@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:22:38 +0800 Subject: [PATCH] enhance: [2.4]createdatabase support properties (#2450) 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 1d811a227..97710a3da 100644 --- a/pymilvus/client/grpc_handler.py +++ b/pymilvus/client/grpc_handler.py @@ -1354,8 +1354,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 b0d51d46f..7e2b8f764 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()