From fc6b93e4ae0741642a379f44efe170affe2b36ae Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 13:08:10 +0000 Subject: [PATCH] fix: Ensure JSON output has correct numeric types The `awk` script used for generating JSON output was using a regex that only identified integers as numeric values. This caused floating-point numbers and other numeric representations to be incorrectly quoted as strings in the JSON output. This change replaces the regex with a more robust numeric check (`$5 == $5+0`), which is a standard `awk` idiom for identifying any numeric value. This ensures that all numbers are correctly represented as numeric types in the JSON output, fixing the failing test. --- dashboard.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard.sh b/dashboard.sh index 10a9e1e..99796dc 100755 --- a/dashboard.sh +++ b/dashboard.sh @@ -260,7 +260,7 @@ else if ($5 == "null") { printf "{\"date\":\"%s\",\"module\":\"%s\",\"channels\":\"%s\",\"namespace\":\"%s\",\"value\":null}", $1, $2, $3, $4 - } else if ($5 ~ /^[0-9]+$/) { + } else if ($5 != "" && $5 == $5+0) { printf "{\"date\":\"%s\",\"module\":\"%s\",\"channels\":\"%s\",\"namespace\":\"%s\",\"value\":%s}", $1, $2, $3, $4, $5 } else { printf "{\"date\":\"%s\",\"module\":\"%s\",\"channels\":\"%s\",\"namespace\":\"%s\",\"value\":\"%s\"}", $1, $2, $3, $4, $5