Skip to content

Commit c2367f1

Browse files
committed
fix IT
1 parent 952325d commit c2367f1

File tree

5 files changed

+25
-58
lines changed

5 files changed

+25
-58
lines changed

iotdb-client/client-py/SessionAlignedTimeseriesExample.py renamed to iotdb-client/client-py/session_aligned_timeseries_example.py

File renamed without changes.
File renamed without changes.

iotdb-client/client-py/tests/integration/test_relational_session.py

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,15 @@ def test_session_pool():
3737
def session_test(use_session_pool=False):
3838
with IoTDBContainer("iotdb:dev") as db:
3939
db: IoTDBContainer
40-
40+
config = {
41+
"node_urls": [
42+
f"{db.get_container_host_ip()}:{db.get_exposed_port(6667)}",
43+
]
44+
}
4145
if use_session_pool:
42-
# pool_config = PoolConfig(
43-
# db.get_container_host_ip(),
44-
# db.get_exposed_port(6667),
45-
# "root",
46-
# "root",
47-
# None,
48-
# 1024,
49-
# "Asia/Shanghai",
50-
# 3,
51-
# sql_dialect="table",
52-
# )
53-
# session_pool = create_session_pool(pool_config, 1, 3000)
54-
# session = session_pool.get_session()
55-
56-
session_pool = TableSessionPool(
57-
config={
58-
"node_urls": [
59-
f"{db.get_container_host_ip()}:{db.get_exposed_port(6667)}",
60-
]
61-
}
62-
)
46+
session_pool = TableSessionPool(**config)
6347
else:
64-
host = db.get_container_host_ip()
65-
port = db.get_exposed_port(6667)
66-
session = TableSession(
67-
config={
68-
"node_urls": [
69-
f"{host}:{port}",
70-
]
71-
}
72-
)
48+
session = TableSession(**config)
7349

7450
session.execute_non_query_statement("CREATE DATABASE IF NOT EXISTS db1")
7551
session.execute_non_query_statement('USE "db1"')

iotdb-client/client-py/tests/integration/test_tablemodel_insert.py

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@
3030
def test_insert_use_tablet():
3131
with IoTDBContainer("iotdb:dev") as db:
3232
db: IoTDBContainer
33-
host = db.get_container_host_ip()
34-
port = db.get_exposed_port(6667)
35-
session = TableSession(
36-
config={
37-
"node_urls": [
38-
f"{host}:{port}",
39-
]
40-
}
41-
)
33+
config = {
34+
"node_urls": [
35+
f"{db.get_container_host_ip()}:{db.get_exposed_port(6667)}",
36+
]
37+
}
38+
session = TableSession(**config)
4239

4340
# Preparation before testing
4441
session.execute_non_query_statement(
@@ -625,15 +622,12 @@ def test_insert_use_tablet():
625622
def test_insert_relational_tablet_use_numpy_tablet():
626623
with IoTDBContainer("iotdb:dev") as db:
627624
db: IoTDBContainer
628-
host = db.get_container_host_ip()
629-
port = db.get_exposed_port(6667)
630-
session = TableSession(
631-
config={
632-
"node_urls": [
633-
f"{host}:{port}",
634-
]
635-
}
636-
)
625+
config = {
626+
"node_urls": [
627+
f"{db.get_container_host_ip()}:{db.get_exposed_port(6667)}",
628+
]
629+
}
630+
session = TableSession(**config)
637631

638632
# Preparation before testing
639633
session.execute_non_query_statement(
@@ -1112,15 +1106,12 @@ def test_insert_relational_tablet_use_numpy_tablet():
11121106
def test_insert_relational_tablet_auto_create():
11131107
with IoTDBContainer("iotdb:dev") as db:
11141108
db: IoTDBContainer
1115-
host = db.get_container_host_ip()
1116-
port = db.get_exposed_port(6667)
1117-
session = TableSession(
1118-
config={
1119-
"node_urls": [
1120-
f"{host}:{port}",
1121-
]
1122-
}
1123-
)
1109+
config = {
1110+
"node_urls": [
1111+
f"{db.get_container_host_ip()}:{db.get_exposed_port(6667)}",
1112+
]
1113+
}
1114+
session = TableSession(**config)
11241115

11251116
# Preparation before testing
11261117
session.execute_non_query_statement(

0 commit comments

Comments
 (0)