From 39e6b63753d46396a845e5d51ac8a4fe3d631f1c Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 9 Dec 2024 16:01:17 +0100 Subject: [PATCH] Fix ping() in case of no connection established yet Otherwise timeout_setter() will try to call gettimeout() of None. --- clickhouse_driver/connection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clickhouse_driver/connection.py b/clickhouse_driver/connection.py index 9255774..7ec2aa2 100644 --- a/clickhouse_driver/connection.py +++ b/clickhouse_driver/connection.py @@ -553,6 +553,9 @@ def send_addendum(self): ) def ping(self): + if not self.socket: + return None + timeout = self.sync_request_timeout with self.timeout_setter(timeout):