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

Migration from influxDB-Python #259

Closed
cfarsbot opened this issue May 20, 2021 · 4 comments · Fixed by #331
Closed

Migration from influxDB-Python #259

cfarsbot opened this issue May 20, 2021 · 4 comments · Fixed by #331
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@cfarsbot
Copy link

Is there any migration guide, when comming from influxDB-Python?
Currently i am on Influx 1.8, but wanna switch to Influx 2
So just staying isn't an option.

For example, i'm missing functions like
influxdb_client.line_protocol
drop_database / create_database
Is there any documentation what the equivalent would be?

@bednar
Copy link
Contributor

bednar commented May 20, 2021

Hi @cfarsbot,

Is there any migration guide, when comming from influxDB-Python?

there isn't the migration guide. Is this something you might be willing to help with?

For example, i'm missing functions like
influxdb_client.line_protocol

You can use Point data structure to construct LineProtocol:

drop_database / create_database

The InfluxDB 2 uses Bucket concept instead of Databases. Here is an example how to manage buckets:

Regards

@bednar bednar added the question Further information is requested label May 20, 2021
@pedvide
Copy link

pedvide commented May 30, 2021

I'm also migrating from 1.8 towards 2.0. My first step has been to migrate from the old to this new client. To replace the create/drop database functions (That I use in my test suite) I call the endpoint directly with:

response = requests.post(
    "http://localhost:8086/query", data={"q": "CREATE DATABASE db"}
)
response.raise_for_status()

Or DROP DATABASE to drop. Change localhost to your server's url. My test db has no password, if you have auth you can use it via requests as well.

@bednar bednar added documentation Improvements or additions to documentation and removed question Further information is requested labels Jul 22, 2021
@yasspoint
Copy link

I have a follow up question on this, in older version I am able to use get_points() function to get back Point objects from query results.
In comparison in the new version query_api().query(".......") returns a list of Flux records and how do I get back Point objects from it?

@bednar
Copy link
Contributor

bednar commented Aug 11, 2021

@yasspoint, unfortunately we don't have a helper to transform FluxRecord to Point

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.

4 participants