From 46ce84d36e2e4f6777c912c947d60b06588c04d9 Mon Sep 17 00:00:00 2001 From: BaptisteDE Date: Fri, 18 Apr 2025 14:47:30 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20timeout=20parameter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tide/influx.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tide/influx.py b/tide/influx.py index 47b0e7a..9a5ac21 100644 --- a/tide/influx.py +++ b/tide/influx.py @@ -29,8 +29,9 @@ def _single_influx_request( org: str, token: str, tz_info: str = "UTC", + timeout: int = 10000, ) -> pd.DataFrame: - client = InfluxDBClient(url=url, org=org, token=token) + client = InfluxDBClient(url=url, org=org, token=token, timeout=timeout) query_api = client.query_api() query = f""" from(bucket: "{bucket}") @@ -75,6 +76,7 @@ def get_influx_data( token: str, split_td: str | dt.timedelta | pd.Timedelta = None, tz_info: str = "UTC", + request_timeout: int = 10000, max_retry: int = 5, waited_seconds_at_retry: int = 5, verbose: bool = False, @@ -225,6 +227,7 @@ def get_influx_data( org=org, token=token, tz_info=tz_info, + timeout=request_timeout, ) ) break From 05a1693eb5b622ddbb10b128e6fa42a2d38e2432 Mon Sep 17 00:00:00 2001 From: BaptisteDE Date: Fri, 18 Apr 2025 14:49:57 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9Dtimeout=20parameter=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tide/influx.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tide/influx.py b/tide/influx.py index 9a5ac21..64275f7 100644 --- a/tide/influx.py +++ b/tide/influx.py @@ -134,6 +134,9 @@ def get_influx_data( Timezone for interpreting start and stop times. Must be a valid timezone name from the IANA Time Zone Database. + request_timeout : int, default 10 000 + Number of ms to wait before the request timeout + max_retry : int, default 5 Maximum number of retry attempts for failed queries. Only applies to ReadTimeoutError exceptions.