Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Imprecise timestamp added with write_points #822

Open
lifeisawavesorideit opened this issue Apr 29, 2020 · 1 comment · May be fixed by #823
Open

Imprecise timestamp added with write_points #822

lifeisawavesorideit opened this issue Apr 29, 2020 · 1 comment · May be fixed by #823

Comments

@lifeisawavesorideit
Copy link

  • InfluxDB version: e.g. 1.7.6
  • InfluxDB-python version: e.g. 5.3.0
  • Python version: e.g. 3.7.4
  • Operating system version: Windows 10

I'm having issues with the precision of the timestamp in nanoseconds when trying to save it to the InfluxDB.

The last 3 rows of my dataframe look as follows:

Timestamp Value
2019-10-09 11:20:38.253 260.30697
2019-10-09 11:20:38.255 260.44757
2019-10-09 11:20:38.257 260.59392

where the Timestamp is set as index with df.index = pd.to_datetime(df.index, unit='ns').

When writing the endpoints to Influx the timestamps with write_points() I obtain following data inserted:
1570620038252999936 260.30697
1570620038255000064 260.44757
1570620038256999936 260.59392

There seems to be someting wrong when writing the data to the InfluxDB. The expected results should look something like:
1570620038253000000 260.30697
1570620038255000000 260.44757
1570620038257000000 260.59392

clslgrnc added a commit to clslgrnc/influxdb-python that referenced this issue May 7, 2020
@clslgrnc clslgrnc linked a pull request May 7, 2020 that will close this issue
2 tasks
@russorat
Copy link
Contributor

russorat commented May 8, 2020

@lifeisawavesorideit thanks for opening! should be fixed with the attached PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants