Skip to content

Commit a869916

Browse files
committed
fix describe database return type
Signed-off-by: Xianhui.Lin <[email protected]> databaseinfo add todict method Signed-off-by: Xianhui.Lin <[email protected]> fix rebase confict Signed-off-by: Xianhui.Lin <[email protected]> flatten the properties into describedb Signed-off-by: Xianhui.Lin <[email protected]> fix code format Signed-off-by: Xianhui.Lin <[email protected]>
1 parent 364da8b commit a869916

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pymilvus/client/grpc_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ def describe_database(self, db_name: str, timeout: Optional[float] = None):
13991399
request = Prepare.describe_database_req(db_name=db_name)
14001400
resp = self._stub.DescribeDatabase(request, timeout=timeout)
14011401
check_status(resp.status)
1402-
return DatabaseInfo(resp)
1402+
return DatabaseInfo(resp).to_dict()
14031403

14041404
@retry_on_rpc_failure()
14051405
def get_load_state(

pymilvus/client/types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,12 @@ def __init__(self, info: Any) -> None:
979979
def __str__(self) -> str:
980980
return f"DatabaseInfo(name={self.name}, properties={self.properties})"
981981

982+
def to_dict(self) -> Dict[str, Any]:
983+
"""Converts the DatabaseInfo instance to a dictionary."""
984+
result = {"name": self.name}
985+
result.update(self.properties)
986+
return result
987+
982988

983989
class ExtraList(list):
984990
"""

0 commit comments

Comments
 (0)