Skip to content
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

Support write_precision in _write_client.write when record is a Pandas dataframe #245

Closed
jdaniel006 opened this issue May 6, 2021 · 1 comment · Fixed by #270
Closed
Labels
enhancement New feature or request
Milestone

Comments

@jdaniel006
Copy link

Proposal:
It may be me failing to find the documentation, but it'd be great to be able to specify a write precision other than nanoseconds when the data is in dataframe format.

Current behavior:
The dataframe serialize function creates timestamps in nanoseconds from the datetime index. If write_precision is different to 'ns', the action fails with time outside range.

Desired behavior:
The dataframe serialize function should use write_precision to format timestamp accordingly.

Alternatives considered:
My workaround at this time is to call data_frame_to_list_of_points to generate a list in line protocol and then modify each line to shorten the timestamp to the desired precision.

Use case:
Critical for whoever wants to write data from dataframe format and not use unneeded precision.

Influxdb version: 2.0.4
influxdb-client: 1.17.0

@bednar
Copy link
Contributor

bednar commented May 7, 2021

@jdaniel006, thanks for using our client, We will take a look.

@bednar bednar added the enhancement New feature or request label May 7, 2021
@bednar bednar added this to the 1.19.0 milestone Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants