Affected Backends: LadybugDB, Kùzu
Unaffected Backends: Neo4j, Falkor
Problem
_render_offline_visualization() exits with:
No graph data returned — index a repository first
when querying a LadybugDB (and likely Kùzu) database that definitely contains indexed data.
Root Cause
The result-parsing helpers in cli_helpers.py (_is_node, _is_relationship, _node_payload, _edge_payload) only check for lowercase dict keys:
Ladybug returns these internal fields as uppercase:
Because none of the dict branches match, every value is discarded, nodes stays empty, and the function bails out.
Reproduction
- Index any repo with LadybugDB as the backend.
- Run
cgc viz (or any command that calls _render_offline_visualization).
- Observe the yellow warning and exit code 1.
- Direct
ladybug queries confirm data exists; the records are plain dicts with uppercase keys.
Expected Behavior
Visualization should degrade gracefully to the offline HTML renderer regardless of whether the backend returns driver objects (Neo4j) or plain dicts with uppercase keys (Ladybug/Kùzu).
Actual Behavior
nodes and edges remain empty; function raises typer.Exit(code=1).
Proposed Fix
Update the four parsing helpers to accept both casing variants:
| Function |
Change |
_is_relationship |
Check ("_src" in v and "_dst" in v) or ("_SRC" in v and "_DST" in v) |
_is_node |
Check ("_label" in v or "_LABEL" in v) and exclude the relationship keys above |
_node_payload |
Fall back from _id → _ID and _label → _LABEL |
_edge_payload |
Fall back from _src/_dst/_label → _SRC/_DST/_LABEL |
This is a minimal, backward-compatible change that keeps Neo4j/Falkor behavior intact while fixing dict-based backends.
Affected Backends: LadybugDB, Kùzu
Unaffected Backends: Neo4j, Falkor
Problem
_render_offline_visualization()exits with:when querying a LadybugDB (and likely Kùzu) database that definitely contains indexed data.
Root Cause
The result-parsing helpers in
cli_helpers.py(_is_node,_is_relationship,_node_payload,_edge_payload) only check for lowercase dict keys:_label_src_dst_idLadybug returns these internal fields as uppercase:
_LABEL_SRC_DST_IDBecause none of the dict branches match, every value is discarded,
nodesstays empty, and the function bails out.Reproduction
cgc viz(or any command that calls_render_offline_visualization).ladybugqueries confirm data exists; the records are plaindicts with uppercase keys.Expected Behavior
Visualization should degrade gracefully to the offline HTML renderer regardless of whether the backend returns driver objects (Neo4j) or plain dicts with uppercase keys (Ladybug/Kùzu).
Actual Behavior
nodesandedgesremain empty; function raisestyper.Exit(code=1).Proposed Fix
Update the four parsing helpers to accept both casing variants:
_is_relationship("_src" in v and "_dst" in v) or ("_SRC" in v and "_DST" in v)_is_node("_label" in v or "_LABEL" in v)and exclude the relationship keys above_node_payload_id→_IDand_label→_LABEL_edge_payload_src/_dst/_label→_SRC/_DST/_LABELThis is a minimal, backward-compatible change that keeps Neo4j/Falkor behavior intact while fixing dict-based backends.