influxdbinfluxdb-2influxdb-python

Undefined identifier in InfluxDB query, invalid binary operator INVALID_OP


I am querying InfluxDB by bucket name and with a range and I got this error: "code":"invalid","message":"error @1:56-1:57: undefined identifier r\\n\\nerror @1:53-1:57: invalid binary operator \\u003cINVALID_OP\\u003e"}' from the following request:

client.query_api().query(query='from(bucket:"bucket_name") |> range(start: -1hr)')

Solution

  • Turns out that the response error is a roundabout way of saying that you should use 1h instead of 1hr. Be careful with your time range formats and it will hopefully save you some time