Skip to content

Commit 889ef09

Browse files
Corrected example
Tested against influxdb-python version 4.0.0
1 parent da39921 commit 889ef09

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/tutorial_pandas.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55

66

77
def main(host='localhost', port=8086):
8+
host='localhost'
9+
port=8086
810
user = 'root'
911
password = 'root'
10-
dbname = 'example'
12+
dbname = 'demo'
13+
# Temporarily used to avoid line protocol time conversion issues #412, #426, #431.
1114
protocol = 'json'
1215

1316
client = DataFrameClient(host, port, user, password, dbname)
@@ -21,16 +24,16 @@ def main(host='localhost', port=8086):
2124
client.create_database(dbname)
2225

2326
print("Write DataFrame")
24-
client.write_points(df, 'demo')
27+
client.write_points(df, 'demo', protocol=protocol)
2528

2629
print("Write DataFrame with Tags")
27-
client.write_points(df, 'demo', {'k1': 'v1', 'k2': 'v2'})
30+
client.write_points(df, 'demo', {'k1': 'v1', 'k2': 'v2'}, protocol=protocol)
2831

2932
print("Read DataFrame")
3033
client.query("select * from demo")
3134

3235
print("Delete database: " + dbname)
33-
client.delete_database(dbname)
36+
client.drop_database(dbname)
3437

3538

3639
def parse_args():

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy