Skip to content

Commit d6a4d3c

Browse files
committed
chore: remove debug strings and update example output
1 parent 3a604f5 commit d6a4d3c

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Examples/basic_ssl_example.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ def remove_cert(file_name):
4848
os.remove(file_name)
4949

5050

51+
def print_results(results: list):
52+
print("%-6s%-6s%-6s%-24s" % ("id", "speed", "ticks", "time"))
53+
for result in results:
54+
print("%-6s%-6.2f%-6i%-24s" % (result['id'], result['speed'], result['ticks'], result['time']))
55+
56+
5157
def main() -> None:
5258
print("Main")
5359
temp_cert_file = "temp_cert.pem"
@@ -61,7 +67,7 @@ def main() -> None:
6167

6268

6369
def write_and_query_with_explicit_sys_cert(conf):
64-
print("write and query with typical linux system cert")
70+
print("\nwrite and query with typical linux system cert\n")
6571
with InfluxDBClient3(token=conf.token,
6672
host=conf.host,
6773
org=conf.org,
@@ -75,11 +81,11 @@ def write_and_query_with_explicit_sys_cert(conf):
7581
query = "SELECT * FROM \"escooter\""
7682
reader: pyarrow.Table = _client.query(query, mode="")
7783
list_results = reader.to_pylist()
78-
print(list_results)
84+
print_results(reader.to_pylist())
7985

8086

8187
def query_with_verify_ssl_off(conf, cert):
82-
print("querying with verify_ssl off")
88+
print("\nquerying with verify_ssl off\n")
8389

8490
# Note that the passed root cert above is bad
8591
# Switch verify_ssl to True to throw SSL_ERROR_SSL
@@ -92,8 +98,7 @@ def query_with_verify_ssl_off(conf, cert):
9298

9399
query = "SELECT * FROM \"escooter\""
94100
reader: pyarrow.Table = _client.query(query, mode="")
95-
list_results = reader.to_pylist()
96-
print(list_results)
101+
print_results(reader.to_pylist())
97102

98103

99104
if __name__ == "__main__":

influxdb_client_3/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ def __init__(
166166
else:
167167
connection_string = f"grpc+tcp://{hostname}:{port}"
168168

169-
print(f"\nDEBUG kwargs.keys {kwargs.keys()}")
170169
q_opts_builder = QueryApiOptionsBuilder()
171170
if kwargs.keys().__contains__('ssl_ca_cert'):
172171
q_opts_builder.root_certs(kwargs.get('ssl_ca_cert', None))

influxdb_client_3/query/query_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def __init__(self,
8787
self._token = token
8888
self._flight_client_options = flight_client_options or {}
8989
self._proxy = proxy
90-
print(f"\nDEBUG options {options}")
9190
if options:
9291
if options.flight_client_options:
9392
self._flight_client_options = options.flight_client_options

0 commit comments

Comments
 (0)