Skip to content

Commit

Permalink
enhance: [2.5] createdatabase support properties (#2449)
Browse files Browse the repository at this point in the history
enhance createdatabase support properties
issue: #2447

---------

Signed-off-by: Xianhui.Lin <[email protected]>
  • Loading branch information
JsDove authored Dec 13, 2024
1 parent ee99052 commit 5c76734
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions pymilvus/client/grpc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions pymilvus/milvus_client/milvus_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5c76734

Please sign in to comment.