SQL Expressions: Return error on malformed input (#110479)

Fixup on a misleading error being returned due to a missing return statement in the code. Was returning the error "conversion succeeded but no frames" even though there was an error.
This commit is contained in:
Kyle Brandt
2025-09-02 14:49:04 -04:00
committed by GitHub
parent 099a43aa10
commit d97836f407
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -236,6 +236,17 @@ func TestHandleSqlInput(t *testing.T) {
expectFrame: true,
converted: true,
},
{
name: "supported type (timeseries-multi) but malformed returns error",
frames: data.Frames{
data.NewFrame("",
data.NewField("time", nil, []string{"1"}), // string is not valid for time field
data.NewField("value", data.Labels{"host": "a"}, []*float64{fp(2)}),
).SetMeta(&data.FrameMeta{Type: data.FrameTypeTimeSeriesMulti}),
},
expectErr: "missing time field",
converted: true,
},
}
for _, tc := range tests {