Skip to content

Commit

Permalink
changed condition
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Galitzky <[email protected]>
  • Loading branch information
amitgalitz committed Nov 21, 2024
1 parent de8061a commit 6089c28
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static ThresholdArrays processDetectorRules(AnomalyDetector detector) {
for (Rule rule : rules) {
for (Condition condition : rule.getConditions()) {
if (condition.getThresholdType() != ThresholdType.ACTUAL_IS_BELOW_EXPECTED
|| condition.getThresholdType() != ThresholdType.ACTUAL_IS_OVER_EXPECTED) {
&& condition.getThresholdType() != ThresholdType.ACTUAL_IS_OVER_EXPECTED) {
processCondition(
condition,
featureNames,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/opensearch/ad/model/Condition.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static Condition parse(XContentParser parser) throws IOException {
case THRESHOLD_TYPE_FIELD:
thresholdType = ThresholdType.valueOf(parser.text().toUpperCase(Locale.ROOT));
break;
case "operator":
case OPERATOR_FIELD:
if (parser.currentToken() == XContentParser.Token.VALUE_NULL) {
operator = null; // Set operator to null if the field is missing
} else {
Expand All @@ -79,7 +79,7 @@ public static Condition parse(XContentParser parser) throws IOException {
break;
case VALUE_FIELD:
if (parser.currentToken() == XContentParser.Token.VALUE_NULL) {
value = null;
value = null; // Set value to null if the field is missing
} else {
value = parser.doubleValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public boolean shouldSave() {
}

public abstract List<IndexableResultType> toIndexableResults(
Config configId,
Config config,
Instant dataStartInstant,
Instant dataEndInstant,
Instant executionStartInstant,
Expand Down

0 comments on commit 6089c28

Please sign in to comment.