I am a InfluxDB/Flux newbie and am practicing my writes and queries. I am closely following the write scripts found both in the documentation and github. In fact, I’ve resorted to just copying the point created to avoid any silly errors. (I’ve xxxxxxxx for security reasons)
from influxdb_client import InfluxDBClient, Point
from influxdb_client.client.write_api import SYNCHRONOUS
from datetime import datetime
#Define variables with name of bucket, organization and token
token = "GtwWZXQg4HoPhRM3T2qrhY3W6WYKvAUNhDjuEZKBTLHXMhiAvlByNAUquu01wZfgusshAvJd6Bxxxxxxxxxxxx"
org = "bsmith@xxxxxxxxx.xx"
bucket = "jak_test_bucket"
url = url="https://us-east-1-1.aws.cloud2.influxdata.com"
#Instantiate the client
client = influxdb_client.InfluxDBClient(url=url, token=token)
write_api = client.write_api(write_options=SYNCHRONOUS)
p = influxdb_client.Point("my_measurement").tag("location","Prague").field("temperature",25.3)
write_api.write(bucket = bucket, org = org, record = p)
As soon as the last line runs, the following error occurs.
Exception has occurred: AttributeError
‘NoneType’ object has no attribute ‘data’
Any help you could give me would be much appreciated!