Skip to content

Migration from influxDB-Python #259

Closed
@cfarsbot

Description

@cfarsbot

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?

Activity

bednar

bednar commented on May 20, 2021

@bednar
Contributor

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

pedvide

pedvide commented on May 30, 2021

@pedvide

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.

added
documentationImprovements or additions to documentation
and removed
questionFurther information is requested
on Jul 22, 2021
yasspoint

yasspoint commented on Aug 11, 2021

@yasspoint

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

bednar commented on Aug 11, 2021

@bednar
Contributor

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

added this to the 1.22.0 milestone on Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @bednar@pedvide@cfarsbot@yasspoint

      Issue actions

        Migration from influxDB-Python · Issue #259 · influxdata/influxdb-client-python