Skip to content

Commit

Permalink
Add repr in connection record (#790)
Browse files Browse the repository at this point in the history
Signed-off-by: XuanYang-cn <xuan.yang@zilliz.com>
  • Loading branch information
XuanYang-cn committed Oct 27, 2021
1 parent 82ca6c5 commit f88ecb2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pymilvus/client/pool.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: UTF-8 -*-

import logging
import os
import queue
import threading
import time
Expand Down Expand Up @@ -65,6 +64,9 @@ def __init__(self, uri, channel=None, handler="GRPC", conn_id=-1, pre_ping=True,
else:
raise ValueError("Unknown handler type. Use GRPC or HTTP")

def __repr__(self):
return f"<ConnectionRecord: {id(self)}> <conn: {id(self._connection)}>"

def _register_link(self):
with RegistryHandler(uri=self._uri, pre_ping=self._pre_ping, conn_id=self._conn_id, **self._kw) as register:
ip, port = register.register_link()
Expand Down Expand Up @@ -112,9 +114,8 @@ def _prepare(self):
raise NotConnectError("Cannot check server version: {}".format(status.message))
if not _is_version_match(version):
raise VersionError(
"Version of python SDK(v{}) not match that of server v{}, excepted is v{}".format(__version__,
version,
support_versions))
f"Version of python SDK(v{__version__}) not match that of server v{version}, excepted is v{support_versions}")

conn.close()

def _inc_used(self):
Expand Down

0 comments on commit f88ecb2

Please sign in to comment.