Closed jar349 closed 8 months ago
While I believe that what I wrote was correct, I also discovered this problem: https://github.com/johanmeijer/grott/issues/455 and I believe that I was "tricked" into thinking that a list
isn't working because there was no data for the measurement. But the measurement was there, which should have been a clue to me that I needed to wait an hour to see the data because of the bug in the linked issue.
Since it does seem that the influxdb2 client library is correctly handling a list
, I am going to close this issue.
Code for sending records to InfluxDB2 lives in
grottdata.py
. Ingrottdata.py
, alist
is created with one element: theifobj
which is thedict
of data we wish to send to InfluxDB2.https://github.com/johanmeijer/grott/blob/master/grottdata.py#L641-L642
However, in the latest release of the influxdb-client-python package (1.38.0), the
write
method on theWriteApi
class accepts adict
but not alist
.https://github.com/influxdata/influxdb-client-python/blob/v1.38.0/influxdb_client/client/write_api.py#L305-L306
When I use your code in the python REPL, I change
ifresult = conf.ifwrite_api.write(conf.ifbucket,conf.iforg,ifjson)
toifresult = conf.ifwrite_api.write(conf.ifbucket,conf.iforg,ifobj)
(send thedict
itself instead of alist
containing thedict
) and then the fields have datapoints assocated with them.Based on this, I propose that grott stop submitting a
list
when using the influxdb2 client and instead directly submit thedict
.