From 693217b740980ad32821cdeb6c08ed892e59ddb8 Mon Sep 17 00:00:00 2001 From: "yihao.dai" Date: Wed, 25 Oct 2023 23:34:02 +0800 Subject: [PATCH] Fix api key (#1757) Signed-off-by: bigsheeper --- pymilvus/orm/connections.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pymilvus/orm/connections.py b/pymilvus/orm/connections.py index a90c778db..783ee823b 100644 --- a/pymilvus/orm/connections.py +++ b/pymilvus/orm/connections.py @@ -319,7 +319,8 @@ def with_config(config: Tuple) -> bool: uri = kwargs.get("uri") if uri is not None: server_type = get_server_type(uri) - if server_type == ZILLIZ and ":" not in token: + parsed_uri = parse.urlparse(uri) + if server_type == ZILLIZ and parsed_uri.port is None: kwargs["uri"] = uri + ":" + str(VIRTUAL_PORT) config = (