Skip to content

Commit 199e22e

Browse files
authored
Merge pull request influxdata#429 from influxdata/jz-pandas-example
Add correct protocol to the Pandas client
2 parents ee6a6b6 + 54347d7 commit 199e22e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/tutorial_pandas.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
def main(host='localhost', port=8086):
88
user = 'root'
99
password = 'root'
10-
dbname = 'example'
10+
dbname = 'demo'
11+
# Temporarily used to avoid line protocol time conversion issues #412, #426, #431.
12+
protocol = 'json'
1113

1214
client = DataFrameClient(host, port, user, password, dbname)
1315

@@ -20,16 +22,16 @@ def main(host='localhost', port=8086):
2022
client.create_database(dbname)
2123

2224
print("Write DataFrame")
23-
client.write_points(df, 'demo')
25+
client.write_points(df, 'demo', protocol=protocol)
2426

2527
print("Write DataFrame with Tags")
26-
client.write_points(df, 'demo', {'k1': 'v1', 'k2': 'v2'})
28+
client.write_points(df, 'demo', {'k1': 'v1', 'k2': 'v2'}, protocol=protocol)
2729

2830
print("Read DataFrame")
2931
client.query("select * from demo")
3032

3133
print("Delete database: " + dbname)
32-
client.delete_database(dbname)
34+
client.drop_database(dbname)
3335

3436

3537
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