influxdata / influxdb-client-python

InfluxDB 2.0 python client
https://influxdb-client.readthedocs.io/en/stable/
MIT License
706 stars 185 forks source link

Pandas outputs warning when calling dataframe.append in flux_csv_parser._prepare_data_frame #613

Open jonashoechst opened 11 months ago

jonashoechst commented 11 months ago

Specifications

Code sample to reproduce problem

query_api.query_data_frame(query)

Expected behavior

The query should be executed without warnings.

Actual behavior

Pandas outputs a FutureWarning:

/usr/local/lib/python3.11/site-packages/influxdb_client/client/flux_csv_parser.py:256: FutureWarning:
The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.

This is related to the this code snippet:

https://github.com/influxdata/influxdb-client-python/blob/aa6e5c4aad1aaf004195c175ebe424ac6040c2e3/influxdb_client/client/flux_csv_parser.py#L243C9-L256

Additional info

In the recent pandas version handling of concatenation of empty dataframes changed, see https://github.com/pandas-dev/pandas/issues/39122. This should be handled else wise to reflect the changes in pandas.

Sciator commented 10 months ago

I wasn't able to replicate this issue. I have tried to run this with 2.0.3 and 2.1.1 pandas with no warning. Could you provide more information (query, data etc.) ?

bednar commented 10 months ago

@sciator, this warning is a part of the Pandas 2.1. For more info see:

On 26. 10. 2023, at 13:35, Sciator @.***> wrote:

I wasn't able to replicate this issue. I have tried to run this with 2.0.3 and 2.1.1 pandas with no warning. Could you provide more information (query, data etc.) ?

— Reply to this email directly, view it on GitHub https://github.com/influxdata/influxdb-client-python/issues/613#issuecomment-1780940139, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADPDYJENWP2Z4PVRRNUCLTYBJDIPAVCNFSM6AAAAAA46NILZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBQHE2DAMJTHE. You are receiving this because you are subscribed to this thread.

ivankudibal commented 9 months ago

pls, it would be great if we have data and the query to reproduce, before we can go on with this issue