We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07d7097 commit 25d1480Copy full SHA for 25d1480
influxdb_client_3/__init__.py
@@ -10,6 +10,8 @@
10
PointSettings
11
from influxdb_client_3.write_client.domain.write_precision import WritePrecision
12
13
+from ipaddress import IPv6Address, AddressValueError
14
+
15
polars = importlib.util.find_spec("polars") is not None
16
17
@@ -147,6 +149,12 @@ def __init__(
147
149
hostname = parsed_url.hostname if parsed_url.hostname else host
148
150
port = parsed_url.port if parsed_url.port else 443
151
152
+ try:
153
+ IPv6Address(hostname)
154
+ hostname = f"[{hostname}]"
155
+ except AddressValueError:
156
+ pass
157
158
# Construct the clients using the parsed values
159
if write_port_overwrite is not None:
160
port = write_port_overwrite
0 commit comments