Can you double check if your DataFrame index is a real datetime index (not strings) and that tag_number is an actual column (not the index), also check for hidden whitespace in column names before calling write_api.write()?
Moreover, here is an helpful article that shows how to turn time column into a pandas DatetimeIndex
In fact it is an integer. I have been ingesting data in influxdb 2.7.4 using nanosecond epochs integers for long. Thus, I don’t understand the exception
I was reading the influx_batch_size in my cloud dev environment as a str. write_api = client.write_api( write_options=WriteOptions(batch_size=influx_batch_size) )
When creating the write_api, there was no exception called.
Only when write_api.write() function is called the exception is raised. But it is not even an influx-client exception, it is a pandas exception.
Despite being a silly error, I believe this typing issues should be controlled by the influx-dbclient libraries, and raise an appropriate informative exception.
A non-monotonic DatetimeIndex can trigger this during string-based slicing. Try df.index = pd.to_datetime(df.index) followed by df = df.sort_index() before calling write_api.write(). If it still fails, share the full traceback and the write call, since the exception may come from preprocessing rather than the InfluxDB client.