Skip to content

Commit 38f1156

Browse files
authored
Revert "fix: support ipv6 hosts (#132)"
This reverts commit 75920ce.
1 parent 75920ce commit 38f1156

File tree

3 files changed

+1
-36
lines changed

3 files changed

+1
-36
lines changed

CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
# 0.17.0 [unreleased]
44

5-
### Bug Fixes
6-
7-
1. [#132](https://github.com/InfluxCommunity/influxdb3-python/pull/132): Fixes support for IPv6 addresses in the `host` parameter of the client. The client now correctly handles IPv6 addresses by enclosing them in square brackets.
8-
95
### CI
106

117
1. [#164](https://github.com/InfluxCommunity/influxdb3-python/pull/164): Fix pipelines not downloading the correct python images.

influxdb_client_3/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
PointSettings, DefaultWriteOptions, WriteType
1616
from influxdb_client_3.write_client.domain.write_precision import WritePrecision
1717

18-
from ipaddress import IPv6Address, AddressValueError
19-
2018
polars = importlib.util.find_spec("polars") is not None
2119

2220
INFLUX_HOST = "INFLUX_HOST"
@@ -268,12 +266,6 @@ def __init__(
268266
hostname = parsed_url.hostname if parsed_url.hostname else host
269267
port = parsed_url.port if parsed_url.port else 443
270268

271-
try:
272-
IPv6Address(hostname)
273-
hostname = f"[{hostname}]"
274-
except AddressValueError:
275-
pass
276-
277269
# Construct the clients using the parsed values
278270
if write_port_overwrite is not None:
279271
port = write_port_overwrite

tests/test_influxdb_client_3.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -135,30 +135,6 @@ async def test_query_async(self):
135135
assert {'data': 'sql_query', 'reference': query, 'value': -1.0} in result_list
136136
assert {'data': 'query_type', 'reference': 'sql', 'value': -1.0} in result_list
137137

138-
@asyncio_run
139-
async def test_query_async_ipv6(self):
140-
with ConstantFlightServer() as server:
141-
client = InfluxDBClient3(
142-
host=f"http://[::1]:{server.port}",
143-
org="my_org",
144-
database="my_db",
145-
token="my_token",
146-
)
147-
148-
query = "SELECT * FROM my_data"
149-
150-
table = await client.query_async(query=query, language="sql")
151-
152-
result_list = table.to_pylist()
153-
154-
cd = ConstantData()
155-
for item in cd.to_list():
156-
assert item in result_list
157-
158-
assert {'data': 'database', 'reference': 'my_db', 'value': -1.0} in result_list
159-
assert {'data': 'sql_query', 'reference': query, 'value': -1.0} in result_list
160-
assert {'data': 'query_type', 'reference': 'sql', 'value': -1.0} in result_list
161-
162138
def test_write_api_custom_options_no_error(self):
163139
write_options = WriteOptions(write_type=WriteType.batching)
164140
write_client_option = {'write_options': write_options}
@@ -376,5 +352,6 @@ def test_get_version_fail(self):
376352
host=f'http://{server.host}:{server.port}', org="ORG", database="DB", token="TOKEN"
377353
).get_server_version()
378354

355+
379356
if __name__ == '__main__':
380357
unittest.main()

0 commit comments

Comments
 (0)