query_graph fails with duckdb 2

Offen Anfängerfreundlich
#752 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
77/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
tooling

Rechercherichtung

Beginne mit duckdb.query_graph/main.py, insbesondere mit _generate_metric_grid_html, bei dem der Traceback einen Fehler identifiziert, wenn im Profil die Latenz auf "N/A" gesetzt ist. Führe die Reproduktionsbefehle aus dem Issue mit DuckDB 2.0.0 aus und untersuche, wie das Profil-JSON verarbeitet wird. Fertig ist die Arbeit, wenn query_graph die Visualisierung für dieses Profil ohne ValueError erzeugt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
Python
Sterne
203
Forks
124
Ø Merge
14 Std. 14 Min.
Gemergte PRs (30 T.)
70

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus duckdb/duckdb-python

Alle Issues in duckdb/duckdb-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.