grafana / grafana-infinity-datasource

CSV, JSON, GraphQL, XML and HTML datasource for grafana.
https://grafana.com/docs/plugins/yesoreyeram-infinity-datasource
Apache License 2.0
740 stars 95 forks source link

[Bug] Summarizing on empty data should not return an error #871

Open hyamanieu opened 4 months ago

hyamanieu commented 4 months ago

Describe the bug

Whether summarizing or not summarizing, if input is empty, it should return an empty value rather than throwing an error. According to me, whether we:

the same result shall be received: an empty Table.

This is important as we cannot know in advance if our API call will return an array with 0 or several elements. It also impacts the use within alerts.

Steps to reproduce

Result:

error getting data frame from inline data. summarize by field not found. Not applying summarize

I would expect the same result as follows:



Result: <0 series returned> (aka empty table)

or for 

- Source: Inline
- Filter : value > 100
- data: `[]`

Result: <0 series returned> (aka empty table)

## **Version Details:**

- Grafana version : 10.4.1
- Plugin version : 0.7.1
digitalkristurner commented 4 months ago

I have also had this issue and it trips me up often!