Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Missleading warning in query "buckets()"

Đang mở
#568 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
pandas, python
Lĩnh vực
databases

Hướng nghiên cứu

Tái hiện cảnh báo bằng InfluxDBClient.query_api().query_data_frame(query='buckets()') sử dụng ví dụ và kiểm tra hành vi của cảnh báo xung quanh điểm vào này. Được xem là hoàn tất khi cảnh báo bị suppress đối với kết quả này hoặc truy vấn được đề xuất tạo ra một dạng kết quả hợp lệ; xác minh thay đổi dựa trên bảng buckets được hiển thị.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Specifications
  • Client Version: v2.6.1
  • InfluxDB Version: 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.6.1'
  • Platform: Ubuntu 22.04.2 LTS, Python 3.10.6
  1. Create a client to a local influx server.
  2. Query the buckets

the last step prints a warning messages that provides a non-working solution. The solution does not apply to the returned table.

Code sample to reproduce problem
>>> from influxdb_client import InfluxDBClient
>>> c = InfluxDBClient(url="http://localhost:8086", org=..., token=...); 
>>> r_api = c.query_api()
>>> r_api.query_data_frame(query='buckets()')
/home/juanpi/virtual_enviroments/wabesense-data/lib/python3.10/site-packages/influxdb_client/client/warnings.py:31: MissingPivotFunction: The query doesn't contains the pivot() function.

The result will not be shaped to optimal processing by pandas.DataFrame. Use the pivot() function by:

    buckets() |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")

You can disable this warning by:
    import warnings
    from influxdb_client.client.warnings import MissingPivotFunction

    warnings.simplefilter("ignore", MissingPivotFunction)

For more info see:
    - https://docs.influxdata.com/resources/videos/pivots-in-flux/
    - https://docs.influxdata.com/flux/latest/stdlib/universe/pivot/
    - https://docs.influxdata.com/flux/latest/stdlib/influxdata/influxdb/schema/fieldsascols/

  warnings.warn(message, MissingPivotFunction)
    result  table         name                id    organizationID retentionPolicy  retentionPeriod
0  _result      0  _monitoring  9ff20ba199aff20d  1f4f3678a832d418            None  604800000000000
1  _result      0       _tasks  7de84af1deb77ca4  1f4f3678a832d418            None  259200000000000
2  _result      0      scratch  c7902563eb5f9007  1f4f3678a832d418            None  604800000000000
Expected behavior

Either the suggested solution should be correct, or no warning should be emitted.

Actual behavior

A solution is provided that does not apply to the returned table.

Additional info

No response

Ngôn ngữ chính
Python
Star
792
Fork
186
Merge trung bình
3 giờ 2 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của influxdata/influxdb-client-python

Tất cả issue của influxdata/influxdb-client-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.