This repository was archived by the owner on Nov 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
quesma/model/metrics_aggregations Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import (
1212
1313func metricsTranslateSqlResponseToJson (ctx context.Context , rows []model.QueryResultRow ) model.JsonMap {
1414 var value any = nil
15- if resultRowsAreFine (ctx , rows ) {
15+ if resultRowsAreFineAndNonEmpty (ctx , rows ) {
1616 value = rows [0 ].Cols [len (rows [0 ].Cols )- 1 ].Value
1717 }
1818 return model.JsonMap {
@@ -30,7 +30,7 @@ func metricsTranslateSqlResponseToJsonWithFieldTypeCheck(
3030 }
3131
3232 var value , valueAsString any = nil , nil
33- if resultRowsAreFine (ctx , rows ) {
33+ if resultRowsAreFineAndNonEmpty (ctx , rows ) {
3434 valueAsAny := rows [0 ].Cols [len (rows [0 ].Cols )- 1 ].Value
3535 if valueAsTime , ok := valueAsAny .(time.Time ); ok {
3636 value = valueAsTime .UnixMilli ()
@@ -48,7 +48,7 @@ func metricsTranslateSqlResponseToJsonWithFieldTypeCheck(
4848 return response
4949}
5050
51- func resultRowsAreFine (ctx context.Context , rows []model.QueryResultRow ) bool {
51+ func resultRowsAreFineAndNonEmpty (ctx context.Context , rows []model.QueryResultRow ) bool {
5252 if len (rows ) == 0 {
5353 return false
5454 }
You can’t perform that action at this time.
0 commit comments