I am using below Python 3.7.3 with influxdb 5.2.2
Trying to insert the DataFrame which has None or NaN
It fails with InfluxDBClientError: 400
It's generating Line Protocol data to be inserted with additional comma in field_set section
Python 3.7.3
$ pip show influxdb
Name: influxdb
Version: 5.2.2
Summary: InfluxDB client
Home-page: https://github.com/influxdb/influxdb-python
Author: None
Author-email: None
License: MIT License
Location: /opt/conda/lib/python3.7/site-packages
Requires: requests, six, pytz, python-dateutil
Required-by:
$ pip show pandas
Name: pandas
Version: 0.24.2
Summary: Powerful data structures for data analysis, time series, and statistics
Home-page: http://pandas.pydata.org
Author: None
Author-email: None
License: BSD
Location: /opt/conda/lib/python3.7/site-packages
Requires: python-dateutil, numpy, pytz
Required-by:
Traceback (most recent call last):
File "test.py", line 29, in <module>
inserted = client.write_points(df, 'TEST', tag_columns = ['tag1','tag2','tag3'] , field_columns = ['val1', 'val2'])
File "/opt/conda/lib/python3.7/site-packages/influxdb/_dataframe_client.py", line 138, in write_points
protocol=protocol)
File "/opt/conda/lib/python3.7/site-packages/influxdb/client.py", line 490, in write_points
tags=tags, protocol=protocol)
File "/opt/conda/lib/python3.7/site-packages/influxdb/client.py", line 551, in _write_points
protocol=protocol
File "/opt/conda/lib/python3.7/site-packages/influxdb/client.py", line 327, in write
headers=headers
File "/opt/conda/lib/python3.7/site-packages/influxdb/client.py", line 286, in request
raise InfluxDBClientError(response.content, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"partial write: unable to parse 'TEST,tag1=a7,tag2=b7,tag3=c7 ,val2=70i 1561467310365975040': invalid field format dropped=0"}
If I take the query with InfluxQL Line Protocol and try to rung it from influx CLI
I get same error.
If i remove the extra comma then it works
> insert TEST,tag1=a7,tag2=b7,tag3=c7 ,val2=70i 1561466427217511936
ERR: {"error":"unable to parse 'TEST,tag1=a7,tag2=b7,tag3=c7 ,val2=70i 1561466427217511936': invalid field format"}
> /* Notice reoving , (comma) before val2 */
> insert TEST,tag1=a7,tag2=b7,tag3=c7 val2=70i 1561466427217511936
>
Hi
I am using below Python 3.7.3 with influxdb 5.2.2 Trying to insert the DataFrame which has None or NaN It fails with InfluxDBClientError: 400 It's generating Line Protocol data to be inserted with additional comma in field_set section
Code snippet to reproduce:
Error stack:
If I take the query with InfluxQL Line Protocol and try to rung it from influx CLI I get same error. If i remove the extra comma then it works