-
-
Notifications
You must be signed in to change notification settings - Fork 226
Open
Description
Describe the bug
During Client initialization with round_robin=True and alternative hosts first Connection in deque initialized with alt_hosts in kwargs
To Reproduce
CREATE TABLE test
(
project_id UInt16,
properties JSON,
timestamp DateTime64(6, 'UTC')
) ENGINE = Memory;
INSERT INTO test(project_id, properties, timestamp)
VALUES (1, '{
"a": 22,
"b": "lorem"
}', now64());
import clickhouse_driver
ch_client = clickhouse_driver.Client(host="localhost",
round_robin=True,
alt_hosts='localhost,localhost'
)
result = ch_client.execute("SELECT * FROM test;")
Expected behavior
I expect that all Connections in self.connections have only 1 host in self.hosts.
You should check round_robin=True and alt_hosts before self.connections = deque([Connection(*args, **kwargs)]) and do kwargs.pop('alt_hosts').
Versions
Version of package: 0.2.9
ClickHouse server version: 24.9.2.42
Python version: 3.12
Metadata
Metadata
Assignees
Labels
No labels