Skip to content

Commit

Permalink
Fix failing code coverage
Browse files Browse the repository at this point in the history
Signed-off-by: currantw <[email protected]>
  • Loading branch information
currantw committed Dec 11, 2024
1 parent 00775ad commit f9f1483
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,7 @@ private ExprValue cast(FunctionExpression castFunction, ReferenceExpression ref)
.put(
BuiltinFunctionName.CAST_TO_IP.getName(),
(expr, ref) -> {
ExprValue value = expr.valueOf();
return value.type().equals(ExprCoreType.IP)
? value
: new ExprIpValue(value.stringValue());
return new ExprIpValue(expr.valueOf().stringValue());
})
.put(
BuiltinFunctionName.CAST_TO_DATE.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ void test_date_has_format() {
}

@Test
void test_non_date_field_type() {
String dateString = "2021-11-08";
void test_string_field_type() {
String dateString = "STRING";
OpenSearchDateType dateType = OpenSearchDateType.of(STRING);
ExprValue literal = ExprValueUtils.stringValue(dateString);
assertNotNull(new RangeQuery(Comparison.LT).doBuild("string_value", dateType, literal));
Expand Down

0 comments on commit f9f1483

Please sign in to comment.