How to pass aditional parameters to clickhouse connect? #24441
Replies: 1 comment 3 replies
-
Try To pass a custom send_receive_timeout in ClickHouse Connect's httpclient.py, you can modify the HTTPClient class constructor to include the send_receive_timeout parameter. Here's an example: class HTTPClient:
def __init__(self, url, send_receive_timeout=10):
self.url = url
self.send_receive_timeout = send_receive_timeout
self.session = requests.Session()
self.session.headers.update({'User-Agent': 'clickhouse-driver'}) In this example, the send_receive_timeout parameter is set to a default value of 10 seconds. You can modify this value to suit your needs. from clickhouse_connect.driver.httpclient import HTTPClient
client = HTTPClient('http://localhost:8123', send_receive_timeout=30)
In this example, the HTTPClient instance is created with a send_receive_timeout value of 30 seconds. This value will be used for all subsequent requests made with this client instance. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I looking to pass custom send_receive_timeout. Can anybody explain how I can do this? Not working with "Engine Parameters" or DSN args.
https://github.com/ClickHouse/clickhouse-connect/blob/main/clickhouse_connect/driver/httpclient.py#L57
https://clickhouse.com/docs/en/integrations/python#connection-arguments
Beta Was this translation helpful? Give feedback.
All reactions