Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 88157d2

Browse files
committed
One line more
1 parent 7129563 commit 88157d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

quesma/model/metrics_aggregations/common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
func 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
}

0 commit comments

Comments
 (0)