influxdata / influxdata/influxdb-client-python

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

未关闭 适合新手
#613 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
793
派生
186
平均合并
3 小时 2 分钟
30 天内合并 PR
1

描述

### 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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 influxdb_client/client/flux_csv_parser.py 第 243-256 行附近开始,这里 query_data_frame 会构建 dataframe,并使用 query_api.query_data_frame(query) 重现该警告。将其行为与 pandas issue 39122 中描述的 pandas 拼接变更进行比较。当查询执行时不再出现报告的 FutureWarning,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
pandas, python
领域
data
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
68/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。