Closed
Description
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 commentedon May 20, 2021
Hi @cfarsbot,
there isn't the migration guide. Is this something you might be willing to help with?
You can use
Point
data structure to construct LineProtocol:influxdb-client-python/influxdb_client/client/write/point.py
Line 45 in a421a6f
The InfluxDB 2 uses
Bucket
concept instead of Databases. Here is an example how to manage buckets:Regards
pedvide commentedon 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:
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.yasspoint commentedon Aug 11, 2021
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 commentedon Aug 11, 2021
@yasspoint, unfortunately we don't have a helper to transform
FluxRecord
toPoint
NamedTuple
,Data Classes
#330