[ML] Fix data value passed to Single Metric viewer chart for anomaly where source data is missing (#154014)

This commit is contained in:
Quynh Nguyen (Quinn) 2023-03-31 10:18:06 -05:00 committed by GitHub
parent 6208a56adb
commit 3930f7aa99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -166,11 +166,7 @@ export function processDataForFocusAnomalies(
if (record.actual !== undefined) {
// If cannot match chart point for anomaly time
// substitute the value with the record's actual so it won't plot as null/0
if (chartPoint.value === null) {
chartPoint.value = record.actual;
}
if (record.function === ML_JOB_AGGREGATION.METRIC) {
if (chartPoint.value === null || record.function === ML_JOB_AGGREGATION.METRIC) {
chartPoint.value = Array.isArray(record.actual) ? record.actual[0] : record.actual;
}