Skip to content

Bug - Offline visualization fails on LadybugDB/Kùzu due to case-sensitive internal key parsing #1458

Description

@FaustoNascimento

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:

  • _label
  • _src
  • _dst
  • _id

Ladybug returns these internal fields as uppercase:

  • _LABEL
  • _SRC
  • _DST
  • _ID

Because none of the dict branches match, every value is discarded, nodes stays empty, and the function bails out.


Reproduction

  1. Index any repo with LadybugDB as the backend.
  2. Run cgc viz (or any command that calls _render_offline_visualization).
  3. Observe the yellow warning and exit code 1.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions