query_graph fails with duckdb 2
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 duckdb.query_graph/main.py 开始,尤其检查 _generate_metric_grid_html;回溯信息指出,当配置文件中的延迟设为 "N/A" 时,这里会失败。使用 DuckDB 2.0.0 运行 issue 中的复现命令,并检查配置文件 JSON 的处理方式。完成标准是 query_graph 能为该配置文件生成可视化结果,且不出现 ValueError。
由索引模型根据 Issue 内容生成。
描述
What happens?
We used to be able to run this to get a visualization of the duckdb profiling. It's still mentioned in the documentation: https://duckdb.org/docs/2.0/dev/profiling#query-graphs
But it doesn't work anymore with duckdb 2. #494 says that query_graph is broken but will be fixed before v2.0. I don't think that happened. Are there plans to fix it?
To Reproduce
First run this with duckdb 2:
SET enable_profiling='json';
SET profile_output = '/tmp/profile.json';
SELECT 1;
python -m duckdb.query_graph --profile_input /tmp/profile.json
<frozen runpy>:130: RuntimeWarning: 'duckdb.query_graph.__main__' found in sys.modules after import of package 'duckdb.query_graph', but prior to execution of 'duckdb.query_graph.__main__'; this may result in unpredictable behaviour
Traceback (most recent call last):
File "<frozen runpy>", line 203, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File ".venv/lib/python3.13/site-packages/duckdb/query_graph/__main__.py", line 672, in <module>
main()
~~~~^^
File ".venv/lib/python3.13/site-packages/duckdb/query_graph/__main__.py", line 665, in main
profiling_info.to_html(output_file=output)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.13/site-packages/duckdb/query_graph/__main__.py", line 339, in to_html
html_output = self._translate_json_to_html(input_text=profiling_info_text, output_file=output_file)
File ".venv/lib/python3.13/site-packages/duckdb/query_graph/__main__.py", line 594, in _translate_json_to_html
highlight_metric_grid = self._generate_metric_grid_html(text)
File ".venv/lib/python3.13/site-packages/duckdb/query_graph/__main__.py", line 505, in _generate_metric_grid_html
"Execution Time (s)": f"{float(json_graph.get('latency', 'N/A')):.4f}",
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: 'N/A'
OS:
mac arm
DuckDB Package Version:
2.0.0
Python Version:
2.0.0
Full Name:
Gishor Sivanrupan
Affiliation:
Exaforce
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a nightly build
Did you include all relevant data sets for reproducing the issue?
Not applicable - the reproduction does not require a data set
Did you include all code required to reproduce the issue?
- Yes, I have
Did you include all relevant configuration to reproduce the issue?
- Yes, I have
- 主要语言
- Python
- 星标
- 203
- 派生
- 124
- 平均合并
- 14 小时 14 分钟
- 30 天内合并 PR
- 70
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
duckdb/duckdb-python 的其他 Issue
-
`read_json` accepts a list of paths at runtime but the type stub only allows a single path.可能已有人在做 @aleks-drozy 于 99 天前认领。 未关闭needs triage
难度 2/5 1-3 小时 新手友好度 78/100
duckdb/duckdb-python#576 · 1 条评论 ·
维护者通常 1 天内回复
-
Missing ROW_GROUPS_PER_FILE argument in write_parquet function可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭needs triage
难度 2/5 1-3 小时 新手友好度 68/100
duckdb/duckdb-python#386 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 54/100
duckdb/duckdb-python#753 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 66/100
duckdb/duckdb-python#737 · 1 条评论 ·
维护者通常 1 天内回复
-
needs triage
难度 3/5 1-2 天 新手友好度 68/100
duckdb/duckdb-python#733 · 2 条评论 ·
维护者通常 1 天内回复
查看 duckdb/duckdb-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
bytedance/agentkit-samples#277 ·
-
ai-driven-fuzzing bug claude Minor
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 2 天内回复
-
channels:edit check:passed
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
aws-samples/sample-aws-genai-db-modernizer#2097 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复