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

Commit 8a09b2d

Browse files
authored
Remove 2 incorrect log messages (#977)
`0` is a completely valid number, even in tests this error happened a lot even when they all passed, so those log messages can't be right, I think. Also should fix log spam.
1 parent 674a501 commit 8a09b2d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

quesma/model/metrics_aggregations/common.go

Lines changed: 3 additions & 4 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 resultRowsAreNonEmpty(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 resultRowsAreNonEmpty(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,9 +48,8 @@ func metricsTranslateSqlResponseToJsonWithFieldTypeCheck(
4848
return response
4949
}
5050

51-
func resultRowsAreFine(ctx context.Context, rows []model.QueryResultRow) bool {
51+
func resultRowsAreNonEmpty(ctx context.Context, rows []model.QueryResultRow) bool {
5252
if len(rows) == 0 {
53-
logger.WarnWithCtx(ctx).Msg("no rows returned for metrics aggregation")
5453
return false
5554
}
5655
if len(rows[0].Cols) == 0 {

quesma/queryparser/pancake_json_rendering.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func (p *pancakeJSONRenderer) selectMetricRows(metricName string, rows []model.Q
3636
}
3737
return []model.QueryResultRow{newRow}
3838
}
39-
logger.ErrorWithCtx(p.ctx).Msgf("no rows in selectMetricRows %s", metricName)
4039
return
4140
}
4241

0 commit comments

Comments
 (0)