This is an automated email from the ASF dual-hosted git repository.
miao pushed a commit to branch grafana_plugin
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/grafana_plugin by this push:
new 2e0db6a141e Fixed the issue of displaying 0 when the number is null
2e0db6a141e is described below
commit 2e0db6a141e14cdb25b8ff9a655dbd33ffd3d37f
Author: luke.miao <[email protected]>
AuthorDate: Tue Dec 10 17:41:22 2024 +0800
Fixed the issue of displaying 0 when the number is null
---
iotdb-connector/grafana-plugin/pkg/plugin/plugin.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/iotdb-connector/grafana-plugin/pkg/plugin/plugin.go
b/iotdb-connector/grafana-plugin/pkg/plugin/plugin.go
index 6ede198155d..a65e987b705 100644
--- a/iotdb-connector/grafana-plugin/pkg/plugin/plugin.go
+++ b/iotdb-connector/grafana-plugin/pkg/plugin/plugin.go
@@ -342,7 +342,9 @@ func recoverType(m []interface{}) interface{} {
case bool:
tmp := make([]float64, len(m))
for i := range m {
- if m[i].(bool) {
+ if m[i] == nil {
+ tmp[i] = math.NaN()
+ } else if m[i].(bool) {
tmp[i] = 1
} else {
tmp[i] = 0