Skip to content

Commit 6089c28

Browse files
committed
changed condition
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
1 parent de8061a commit 6089c28

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/main/java/org/opensearch/ad/ml/IgnoreSimilarExtractor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static ThresholdArrays processDetectorRules(AnomalyDetector detector) {
5454
for (Rule rule : rules) {
5555
for (Condition condition : rule.getConditions()) {
5656
if (condition.getThresholdType() != ThresholdType.ACTUAL_IS_BELOW_EXPECTED
57-
|| condition.getThresholdType() != ThresholdType.ACTUAL_IS_OVER_EXPECTED) {
57+
&& condition.getThresholdType() != ThresholdType.ACTUAL_IS_OVER_EXPECTED) {
5858
processCondition(
5959
condition,
6060
featureNames,

src/main/java/org/opensearch/ad/model/Condition.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static Condition parse(XContentParser parser) throws IOException {
7070
case THRESHOLD_TYPE_FIELD:
7171
thresholdType = ThresholdType.valueOf(parser.text().toUpperCase(Locale.ROOT));
7272
break;
73-
case "operator":
73+
case OPERATOR_FIELD:
7474
if (parser.currentToken() == XContentParser.Token.VALUE_NULL) {
7575
operator = null; // Set operator to null if the field is missing
7676
} else {
@@ -79,7 +79,7 @@ public static Condition parse(XContentParser parser) throws IOException {
7979
break;
8080
case VALUE_FIELD:
8181
if (parser.currentToken() == XContentParser.Token.VALUE_NULL) {
82-
value = null;
82+
value = null; // Set value to null if the field is missing
8383
} else {
8484
value = parser.doubleValue();
8585
}

src/main/java/org/opensearch/timeseries/transport/ResultResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public boolean shouldSave() {
9090
}
9191

9292
public abstract List<IndexableResultType> toIndexableResults(
93-
Config configId,
93+
Config config,
9494
Instant dataStartInstant,
9595
Instant dataEndInstant,
9696
Instant executionStartInstant,

0 commit comments

Comments
 (0)