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 小時 新手友好度 66/100
navikt/tiltakspenger#129 ·
-
難度 1/5 1-3 小時 新手友好度 83/100
FinanceFlash/unvibecode#652 ·
維護者通常 1 天內回覆
-
netbox status: needs triage type: documentation
難度 2/5 1-3 小時 新手友好度 76/100
netbox-community/netbox#23655 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 73/100
MCDReforged/MCDReforged#442 ·
-
難度 2/5 1-3 小時 新手友好度 72/100
bytedance/agentkit-samples#277 ·