-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Allow null data points for time series #170
Conversation
Code coverage report for PR #170
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I see you figured out how these integration tests work :)
pkg/timestream/helper.go
Outdated
if tv == nil { | ||
dr.Error = fmt.Errorf("Expecting timeseries colum at: %d", timeseriesColumn.columnIdx) | ||
isNullDataPoint := series.Data[timeseriesColumn.columnIdx].NullValue | ||
if tv == nil && !*isNullDataPoint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to check if the pointer is null to avoid a possible panic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof, nice catch.
Grafana shows "No Data" for this scenario when using influx db instead of an empty graph. I tried to replicate the same behavior with timestream, but I did not manage to do it. |
@brunoleite, if you use the following SELECT interpolatedValue
FROM interpolatedTimeseries
WHERE interpolatedValue IS NOT NULL instead of SELECT *
FROM interpolatedTimeseries It should not return any rows and will show "No Data". |
Currently, if a column includes
TimeSeriesMeasureValueColumnInfo
we assume that it also has a time series valuetimestream-datasource/pkg/timestream/helper.go
Lines 39 to 53 in 7f68a0b
However, it could just be a null data point.
This PR allows data points to be a null value instead of assuming it must be present.
This fixes #168. You can see a screenshot of what the error looked like in the panel in the linked issue.
Currently this is what the Timestream query editor shows when there are null data points.
With the changes in this PR this is what Grafana looks like now