Missleading warning in query "buckets()"
还没有人认领这个 Issue。
评估
调研方向
使用示例通过 InfluxDBClient.query_api().query_data_frame(query='buckets()') 重现警告,并检查此入口点附近的警告行为。完成的标准是针对该结果抑制警告,或使建议的查询生成有效的结果形状;根据所示的 buckets 表验证更改。
由索引模型根据 Issue 内容生成。
描述
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
- Create a client to a local influx server.
- 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
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
influxdata/influxdb-client-python 的其他 Issue
-
Pandas outputs warning when calling dataframe.append in flux_csv_parser._prepare_data_frame可能已有人在做 @dave-cz 于 407 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
influxdata/influxdb-client-python#613 · 7 条评论 ·
-
bug
难度 3/5 1-2 天 新手友好度 65/100
-
难度 3/5 1-2 天 新手友好度 45/100
influxdata/influxdb-client-python#694 · 6 个 reaction ·
-
bug
难度 3/5 1-2 天 新手友好度 30/100
influxdata/influxdb-client-python#693 · 2 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
查看 influxdata/influxdb-client-python 的全部 Issue
相似的 Issue
-
area: desktop area: website priority: P2 type: feature
难度 2/5 1-3 小时 新手友好度 62/100
appandflow/stim#3411 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1 小时以内 新手友好度 88/100
baptistehamon/lsapy#185 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
PolicyEngine/policyengine-us#10073 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
syedhamidali/radarx#277 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
Arekkazu/sgpmp-backend#549 ·
维护者通常 1 天内回复