From b073c37db02b113e49d2984a8dd3075895587d4a Mon Sep 17 00:00:00 2001 From: ahosking Date: Sun, 3 Jul 2022 01:17:37 -0400 Subject: [PATCH] Rearrage Write Query --- influx_frontend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/influx_frontend.py b/influx_frontend.py index be9f243..11c175f 100644 --- a/influx_frontend.py +++ b/influx_frontend.py @@ -88,8 +88,8 @@ def add_time(): print(dt) print() write_api = client.write_api(write_options=SYNCHRONOUS) - p = influxdb_client.Point("2016_odyssey").time(timestamp).field("odometer", float(odometer)).tag("oilhealth", oilhealth)\ - .tag("fuel", fuel).field("fuelcost", fuelcost).tag("winter", winter) + p = influxdb_client.Point("2016_odyssey").time(timestamp).tag("oilhealth", oilhealth)\ + .tag("fuel", fuel).field("fuelcost", fuelcost).tag("winter", winter).field("odometer", float(odometer)) write_api.write(bucket="gas", org=config['DB_ORG'], record=p) print ("Submitting data to DB: {0}".format(json_body)) #client.write_points(json_body)