influxdata / influxdata/influxdb-client-python

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

Offen Anfängerfreundlich
#613 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Python
Sterne
793
Forks
186
Ø Merge
3 Std. 2 Min.
Gemergte PRs (30 T.)
1

Beschreibung

### Specifications

* Client Version: 1.36.0
* InfluxDB Version: 2.7

### Code sample to reproduce problem

```python
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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne in influxdb_client/client/flux_csv_parser.py etwa bei den Zeilen 243–256, wo query_data_frame den DataFrame erstellt, und reproduziere die Warnung mit query_api.query_data_frame(query). Vergleiche das Verhalten mit der in pandas issue 39122 beschriebenen Änderung bei der pandas-Konkatenation. Als erledigt gilt die Aufgabe, wenn die Abfrage ohne die gemeldete FutureWarning ausgeführt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
pandas, python
Bereich
data
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.