Timestamps' seconds rounded up in batch upload using line protocol


I am trying to upload a set of data points to influxDB-Cloud (V2.0) using the influx-client library in Python. I timestamped my data points using RFC3339 format and turned them into Pandas dataframe before uploading. But, for example, when I upload a data point with the timestamp 2022-01-20 10:10:16 it rounds up the second 16th to 20th, no matter what the write precision is. My research is dependent on this datapoint batch upload but trying all takes a huge amount of time. I checked everything with documentation of write api of V2.0 cloud but still, it doesn’t work properly.

token = "the associated token"
org = "organizaiton name"
bucket = "bucket name"
client_influx= InfluxDBClient(url="https://eu-central-1-1.aws.cloud2.influxdata.com", token=token, timeout=1000, verify_ssl=False)
write_api = client_influx.write_api(write_options=SYNCHRONOUS)
#some code blocks....
h = DFrows[[0,1,2,3,5,6]].set_index(DFrows[4])
write_api.write(bucket, org, record=h, data_frame_measurement_name='Test_measurement',
                        data_frame_tag_columns=['tag1','tag2'], write_precision="s")

I also check the monitoring section and it was not showing any error such as parsing error or invalid timestamp (or timestamp range). I tried the following timestamp and write precisions: “s”, “ms”, “us”, “ns”…

I need to add I’m using the free version of influxDB cloud (not sure if it has an effect on the accepted precision)

Hi @Reza_Rajaee,

thanks for using our client.

Your code looks fine. Can you share a little bit more about your data and debug output of client?

You can enable debug by:

client_influx= InfluxDBClient(url="https://eu-central-1-1.aws.cloud2.influxdata.com", token=token, timeout=1000, verify_ssl=False, debug=True)