Skip to content

Nanosecond Precision #314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dkasianov opened this issue Aug 18, 2021 · 2 comments · Fixed by #315
Closed

Nanosecond Precision #314

dkasianov opened this issue Aug 18, 2021 · 2 comments · Fixed by #315
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@dkasianov
Copy link

if isinstance(timestamp, timedelta) or isinstance(timestamp, datetime):

It seems that python client not support insert of nanosecond precision, I try to use standard timestamp precision and found out that it doesn't support nanoseconds precision to achieve that I use pandas, it seems your client depends on standard one and its cut off nanoseconds precision.

Maybe this not the case (I am not experienced in Python) but I can't write down pandas timestamp with nanosecond precision into client.

Thanks,
Daniil

@bednar
Copy link
Contributor

bednar commented Aug 19, 2021

Hi @dkasianov,

thanks for using our client.

The Python's datetime doesn't support precision with nanoseconds so the library during writes and queries ignores everything after microseconds.

If you would like to use datetime with nanosecond precision you should use pandas.Timestamp that is replacement for python datetime.datetime object and also you should set a proper DateTimeHelper to the client.

for more info see - https://github.com/influxdata/influxdb-client-python#nanosecond-precision

Regards

@bednar bednar added the documentation Improvements or additions to documentation label Aug 19, 2021
@dkasianov
Copy link
Author

Thanks, I did goggle that but answer was under my nose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants