-
Notifications
You must be signed in to change notification settings - Fork 523
DataFrameClient Aggregated query not able to see time column label and tag columns #785
Comments
@ashishkaransingh thanks for opening this! I've pinged some coworkers that have used Influx and Juptyer notebooks to see if they can help out. |
Hi, I made little investigation of this issue and it looks like the query result is not properly converted into DataFrames. In your case the query returns multiple time series (DataFrames), each for host/ instance combination and the tag values are missing in DataFrames. Tag columns should be marked as indexes and values should be present in DataFrame. Then it will be possible to join multiple DataFrames using Here is the link to problematic implementation influxdb-python/influxdb/_dataframe_client.py Line 213 in cb15c2e
The new InfluxDB 2.0 python client (query using Flux language) https://github.com/influxdata/influxdb-client-python works correctly. Possible workaround is to use simple query like "SELECT usage_user, host, cpu FROM "telegraf"."autogen"."cpu" WHERE time > now() - 1m" and group data in pandas or try new InfluxDB 2.0 beta and new client library. |
@russorat Sorry for the late reply and thank you getting traction on this! |
@rhajek Thank you so much for pointing out the problematic implementation _to_dataframe method. Even simple queries like the one mentioned below fails to get tag = time but does get "host"!
|
@rhajek |
Working on a fix for this now, thanks for the report! |
Same issue. Any ETA? |
Thank you! |
For the time being, upgrade to 1.8.x and use the new python client. Since 1.8 supports the v2 API...you can use the v2 python client starting with the 1.8 release. |
…ndexes Fix: add support for custom indexes for query in the DataFrameClient (#785)
@russorat thanks for the update, i have one question.
Not sure how if this can be used and how to implement this: Thanks |
@reactcker Thanks, you can use the then you can use the |
Can someone please help.
Using Jupyter Notebook (anaconda3).
I do not see label "time" nor other tag "host" and "instance".
See df.columns only returned field "Percent_Processor_Time"
I am pulling data using influxdb DataFrameClient.
The text was updated successfully, but these errors were encountered: