From 5786458ca05e4ba3c83d93f6ae3c43649c50c630 Mon Sep 17 00:00:00 2001
From: Christoph Alt <typ@ohnebild.com>
Date: Thu, 13 Oct 2022 17:10:52 +0200
Subject: [PATCH] fixed the annotation query for dbs with complex field type
 fixes #1

---
 dashboards/dashboard_base.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dashboards/dashboard_base.py b/dashboards/dashboard_base.py
index 9be7461..c22dc0d 100644
--- a/dashboards/dashboard_base.py
+++ b/dashboards/dashboard_base.py
@@ -22,9 +22,9 @@ def get_annotation(*args, **kwargs):
 
 
 def get_commit_annotation(datasource: str, color: str, name: str, measurment_name: str):
-    query = ("SELECT \"commit\" from "
-             f"( SELECT first(/./) FROM \"{measurment_name}\" "
-             "WHERE host =~ /^$host$/ AND $timeFilter GROUP BY \"commit\" )")
+    query = ("SELECT first(\"commit\") FROM "
+             f"( SELECT * FROM \"{measurment_name}\" "
+             "WHERE host =~ /^$host$/ AND $timeFilter) GROUP BY \"commit\"")
     return get_annotation(datasource, color, name, query)
 
 
-- 
GitLab