influxdata / influxdata/influxdb-client-python
Pandas outputs warning when calling dataframe.append in flux_csv_parser._prepare_data_frame
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 793
- Fork
- 186
- Merge trung bình
- 3 giờ 2 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
### 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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu trong influxdb_client/client/flux_csv_parser.py, khoảng các dòng 243-256, nơi query_data_frame xây dựng dataframe, và tái hiện cảnh báo bằng query_api.query_data_frame(query). So sánh hành vi với thay đổi về việc nối của pandas được mô tả trong pandas issue 39122. Hoàn tất khi truy vấn thực thi mà không có FutureWarning đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- pandas, python
- Lĩnh vực
- data
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 68/100