Skip to content

Commit 6f65971

Browse files
authored
Merge branch 'main' into short_circuit_results_add_global_filter
2 parents b4dfbbd + 3a95e75 commit 6f65971

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/main/java/org/gridsuite/computation/utils/SpecificationUtils.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) 2025, RTE (http://www.rte-france.com)
3-
* This Source Code Form is subject to the terms of the Mozilla Public
4-
* License, v. 2.0. If a copy of the MPL was not distributed with this
5-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6-
*/
7-
81
/**
92
* Copyright (c) 2025, RTE (http://www.rte-france.com)
103
* This Source Code Form is subject to the terms of the Mozilla Public
@@ -233,6 +226,8 @@ private static <X> Specification<X> appendNumberFilterToSpecification(Specificat
233226
specification.and(lessThanOrEqual(resourceFilter.column(), valueDouble, tolerance));
234227
case GREATER_THAN_OR_EQUAL ->
235228
specification.and(greaterThanOrEqual(resourceFilter.column(), valueDouble, tolerance));
229+
case EQUALS -> specification.and(greaterThanOrEqual(resourceFilter.column(), valueDouble, tolerance))
230+
.and(lessThanOrEqual(resourceFilter.column(), valueDouble, tolerance));
236231
default ->
237232
throw new IllegalArgumentException("The filter type " + resourceFilter.type() + " is not supported with the data type " + resourceFilter.dataType());
238233
};

src/test/java/org/gridsuite/computation/specification/CommonSpecificationBuilderTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ void testBuildSpecification() {
8888
new ResourceFilterDTO(TEXT, CONTAINS, List.of("partialValue1", "partialValue2"), "dummyColumn"),
8989
new ResourceFilterDTO(NUMBER, LESS_THAN_OR_EQUAL, 100.0157, "dummyNumberColumn"),
9090
new ResourceFilterDTO(NUMBER, GREATER_THAN_OR_EQUAL, 10, "dummyNumberColumn", 0.1),
91-
new ResourceFilterDTO(NUMBER, NOT_EQUAL, 10, "parent.dummyNumberColumn")
91+
new ResourceFilterDTO(NUMBER, NOT_EQUAL, 10, "parent.dummyNumberColumn"),
92+
new ResourceFilterDTO(NUMBER, EQUALS, 42.000, "dummyNumberColumn")
9293
);
9394
List<ResourceFilterDTO> resourceFiltersWithChildren = List.of(
9495
new ResourceFilterDTO(NUMBER, NOT_EQUAL, 10, "parent.dummyNumberColumn")

0 commit comments

Comments
 (0)