query_graph fails with duckdb 2

オープン 初心者向け
#752 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
77/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
tooling

調査の方向性

duckdb.query_graph/main.pyから始め、特に、プロファイルのレイテンシが"N/A"に設定されているときに失敗するとトレースバックが示している_generate_metric_grid_htmlを確認してください。DuckDB 2.0.0でissueの再現コマンドを実行し、プロファイルJSONの処理方法を調べてください。query_graphがValueErrorを発生させずにそのプロファイルの可視化を生成できれば完了です。

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

説明

needs triage
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分
マージ済み PR(30日)
70

環境構築

はじめの一歩

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

duckdb/duckdb-python のほかの issue

duckdb/duckdb-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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