Skip to content

Commit

Permalink
Fix TCP keepalive idle_time_sec, interval_sec type
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Apr 23, 2024
1 parent 2b35f97 commit 1adf65d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clickhouse_driver/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def from_url(cls, url):
except ValueError:
parts = value.split(',')
kwargs[name] = (
float(parts[0]), float(parts[1]), int(parts[2])
int(parts[0]), int(parts[1]), int(parts[2])
)
elif name == 'client_revision':
kwargs[name] = int(value)
Expand Down
2 changes: 1 addition & 1 deletion docs/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ You can also specify custom keepalive settings with tuple

.. code-block:: python
>>> client = Client('localhost', tcp_keepalive=(60.5, 5.1, 2))
>>> client = Client('localhost', tcp_keepalive=(60, 5, 2))
.. note::

Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ def test_tcp_keepalive(self):
c = Client.from_url('clickhouse://host?tcp_keepalive=true')
self.assertTrue(c.connection.tcp_keepalive)

c = Client.from_url('clickhouse://host?tcp_keepalive=10.5,2.5,3')
c = Client.from_url('clickhouse://host?tcp_keepalive=10,2,3')
self.assertEqual(
c.connection.tcp_keepalive, (10.5, 2.5, 3)
c.connection.tcp_keepalive, (10, 2, 3)
)

def test_client_revision(self):
Expand Down

0 comments on commit 1adf65d

Please sign in to comment.