[v9.5.x] SSE: Fix DSNode to not panic when response has empty response (#74874)

Fix DSNode to not panic when response has empty response (#74866)
This commit is contained in:
Yuri Tseretyan
2023-09-13 15:17:03 -04:00
committed by GitHub
parent 56e07f9c55
commit a76927f7a3
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -201,6 +201,11 @@ func TestConvertDataFramesToResults(t *testing.T) {
return dsNode.Execute(context.Background(), time.Now(), nil, s)
}
t.Run("should return NoData if no frames", func(t *testing.T) {
result, err := execute(nil, "test")
require.NoError(t, err)
require.Equal(t, mathexp.NewNoData(), result.Values[0].Value())
})
t.Run("should add name label if no labels and specific data source", func(t *testing.T) {
supported := []string{datasources.DS_GRAPHITE, datasources.DS_TESTDATA}
t.Run("when only field name is specified", func(t *testing.T) {