Skip to content

Erroneous integer return values break InfluxDB type inference #6

Description

@Gadgetoid

Currently rain and other values are set to integer 0 on startup and later changed to a calculated float value. This breaks InfluxDB since it infers an integer type from the first datapoint and subsequent floats fail with "field type conflict":

Traceback (most recent call last):
  File "send-to-influx.py", line 101, in <module>
    client.write_points(payload)
  File "/home/pi/.local/lib/python3.7/site-packages/influxdb/client.py", line 608, in write_points
    consistency=consistency)
  File "/home/pi/.local/lib/python3.7/site-packages/influxdb/client.py", line 685, in _write_points
    protocol=protocol
  File "/home/pi/.local/lib/python3.7/site-packages/influxdb/client.py", line 419, in write
    headers=headers
  File "/home/pi/.local/lib/python3.7/site-packages/influxdb/client.py", line 378, in request
    raise InfluxDBClientError(err_msg, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"partial write: field type conflict: input field \"rain\" on measurement \"weather\" is type float, already exists as type integer dropped=1"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions