Abdullah Tahir
Abdullah Tahir

Reputation: 157

Having issue while inserting data in influxdb using python client

measurement = "measurement"
for column in df.columns:
    for index, value in enumerate(df[column]):
        point = Point(measurement).field(column, value).time(df['unix_time_column'].iloc[index], write_precision="ns")
        write_api.write(bucket="CSV", record=point)

The above code block i'm using to insert some value from dataframe to influx bucket. But whenever I'm adding time the value is not inserting but on the other hand if I remove the time from the it works time.

PS: I check the precision of the also.

Thanks in advance.

Upvotes: 0

Views: 101

Answers (1)

Maxwell E Gyamfi
Maxwell E Gyamfi

Reputation: 1

I think the data is getting inserted. The main issue you're facing is that you're not selecting your data by your date-time you've defined but by InfluxDB current date-time.

Lets say your date is 1/1/2000 and today is 4/06/2024. You need to select date-time of 1/1/2000 and not 4/06/2024 as you've defined the date-time yourself.

Upvotes: 0

Related Questions