Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tide/influx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -132,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.
Expand Down Expand Up @@ -225,6 +230,7 @@ def get_influx_data(
org=org,
token=token,
tz_info=tz_info,
timeout=request_timeout,
)
)
break
Expand Down