Skip to content

Commit

Permalink
Fix a bug in parse response to get expected value (opensearch-project…
Browse files Browse the repository at this point in the history
…#306)

* fix failed unit tests

Signed-off-by: Jackie Han <[email protected]>

* Fix parse result bug for feature attribution

Signed-off-by: Jackie Han <[email protected]>

Signed-off-by: Jackie Han <[email protected]>
  • Loading branch information
jackiehanyang authored Aug 10, 2022
1 parent 77c0931 commit 7ace8b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/routes/ad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ export default class AdService {
? toFixedNumberForAnomaly(Number.parseFloat(featureData.data))
: 0,
name: featureData.feature_name,
expectedValue: result.anomaly_grade > 0
expectedValue: result._source.anomaly_grade > 0
? this.getExpectedValue(result, featureData.feature_id) : featureData.data
});
});
Expand Down Expand Up @@ -1135,7 +1135,7 @@ export default class AdService {
? toFixedNumberForAnomaly(Number.parseFloat(featureData.data))
: 0,
name: featureData.feature_name,
expectedValue: rawResult.anomaly_grade > 0
expectedValue: rawResult._source.anomaly_grade > 0
? this.getExpectedValue(rawResult, featureData.feature_id)
: featureData.data
};
Expand Down

0 comments on commit 7ace8b4

Please sign in to comment.