Influxdb PythonXDBClient-如何将精度设置为秒?

Influxdb PythonXDBClient-如何将精度设置为秒?,influxdb,influxdb-python,Influxdb,Influxdb Python,我正在将数据点写入XDB数据库,以便grafana显示。 我有以秒为单位的源数据点时间 Grafana显示该点,但图形上的时间设置为1970。我怀疑这是精度的问题,因为grafana默认使用纳秒。 我尝试将精度设置为秒 from influxdb import InfluxDBClient client.write_points(entry, params={'epoch': 's'}) 但它会产生错误: client.write_points(entry, params={'epoc

我正在将数据点写入XDB数据库,以便grafana显示。 我有以秒为单位的源数据点
时间

Grafana显示该点,但图形上的时间设置为1970。我怀疑这是精度的问题,因为grafana默认使用纳秒。 我尝试将精度设置为秒

from influxdb import InfluxDBClient


client.write_points(entry, params={'epoch': 's'})
但它会产生错误:

  client.write_points(entry, params={'epoch': 's'})
TypeError: write_points() got an unexpected keyword argument 'params'

如果要将精度设置为秒

client.write_points(entry, time_precision='s')
这就是诀窍