Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Missleading warning in query "buckets()"

オープン
#568 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
pandas, python
領域
databases

調査の方向性

例を使って InfluxDBClient.query_api().query_data_frame(query='buckets()') の警告を再現し、このエントリポイント周辺の警告の挙動を調査します。完了条件は、この結果に対する警告が抑制されるか、提案されたクエリが有効な結果形状を生成することです。示されている buckets テーブルに対して変更を検証してください。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
792
フォーク
186
平均マージ
3時間 2分
マージ済み PR(30日)
1

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

influxdata/influxdb-client-python のほかの issue

influxdata/influxdb-client-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。