feat: instrument analysis

This commit is contained in:
OpenSquared
2026-06-29 00:06:14 +02:00
parent 3bcecdab09
commit 5e65424500
3 changed files with 28 additions and 5 deletions

View File

@@ -1176,7 +1176,7 @@ def list_analyses(
rows = conn.execute(f"""
SELECT a.*, e.name as event_name, e.category, e.start_date,
t.name as template_name
t.name as template_name, t.graph_json as template_graph_json
FROM causal_event_analyses a
LEFT JOIN market_events e ON e.id = a.market_event_id
LEFT JOIN causal_graph_templates t ON t.id = a.template_id
@@ -1194,6 +1194,10 @@ def list_analyses(
d[f] = json.loads(d[f] or "{}")
except Exception:
d[f] = {}
try:
d["graph_json"] = json.loads(d.get("template_graph_json") or "{}")
except Exception:
d["graph_json"] = {}
result.append(d)
return result