aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/clickhouse-connect/clickhouse_connect/driver
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-02-06 12:16:37 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-02-06 12:33:49 +0300
commitf4e5229f058bb21a8e634dd57f78585b40abd65a (patch)
tree3f175c6df5e992aecbefacb1a8ab361ae1ef5670 /contrib/python/clickhouse-connect/clickhouse_connect/driver
parent1daa4c5f73655eacce7b28d9494c831827970ef3 (diff)
downloadydb-f4e5229f058bb21a8e634dd57f78585b40abd65a.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/clickhouse-connect/clickhouse_connect/driver')
-rw-r--r--contrib/python/clickhouse-connect/clickhouse_connect/driver/httpclient.py8
-rw-r--r--contrib/python/clickhouse-connect/clickhouse_connect/driver/models.py6
2 files changed, 11 insertions, 3 deletions
diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/driver/httpclient.py b/contrib/python/clickhouse-connect/clickhouse_connect/driver/httpclient.py
index c8fa9e6116..7d72b95aa3 100644
--- a/contrib/python/clickhouse-connect/clickhouse_connect/driver/httpclient.py
+++ b/contrib/python/clickhouse-connect/clickhouse_connect/driver/httpclient.py
@@ -74,7 +74,7 @@ class HttpClient(Client):
"""
self.url = f'{interface}://{host}:{port}'
self.headers = {}
- ch_settings = settings or {}
+ ch_settings = dict_copy(settings, self.params)
self.http = pool_mgr
if interface == 'https':
if not https_proxy:
@@ -113,7 +113,11 @@ class HttpClient(Client):
self._read_format = self._write_format = 'Native'
self._transform = NativeTransform()
- connect_timeout, send_receive_timeout = coerce_int(connect_timeout), coerce_int(send_receive_timeout)
+ # There is use cases when client need to disable timeouts.
+ if connect_timeout is not None:
+ connect_timeout = coerce_int(connect_timeout)
+ if send_receive_timeout is not None:
+ send_receive_timeout = coerce_int(send_receive_timeout)
self.timeout = Timeout(connect=connect_timeout, read=send_receive_timeout)
self.http_retries = 1
self._send_progress = None
diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/driver/models.py b/contrib/python/clickhouse-connect/clickhouse_connect/driver/models.py
index 054c7b686a..38407d1c63 100644
--- a/contrib/python/clickhouse-connect/clickhouse_connect/driver/models.py
+++ b/contrib/python/clickhouse-connect/clickhouse_connect/driver/models.py
@@ -16,8 +16,12 @@ class ColumnDef(NamedTuple):
ttl_expression: str
@property
+ def type_name(self):
+ return self.type.replace('\n', '').strip()
+
+ @property
def ch_type(self):
- return get_from_name(self.type)
+ return get_from_name(self.type_name)
class SettingDef(NamedTuple):