From a3ce8568011169c6dd84a2e4e501ed46cebffebe Mon Sep 17 00:00:00 2001 From: Mark Tozzi Date: Tue, 3 Dec 2024 13:19:53 -0500 Subject: [PATCH] fix add --- .../expression/predicate/operator/arithmetic/AddTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddTests.java index 2022fe1cb1579..ae44a7a1d5cd3 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddTests.java @@ -159,7 +159,7 @@ public static Iterable parameters() { }; BiFunction> warnings = (lhs, rhs) -> { try { - addDatesAndTemporalAmount(lhs.data(), rhs.data(), AddTests::addMillis); + addDatesAndTemporalAmount(lhs.getValue(), rhs.getValue(), AddTests::addMillis); return List.of(); } catch (ArithmeticException e) { return List.of( @@ -332,6 +332,7 @@ private static Object addDatesAndTemporalAmount(Object lhs, Object rhs, ToLongBi // this weird casting dance makes the expected value lambda symmetric Instant date; TemporalAmount period; + assert (lhs instanceof Instant) || (rhs instanceof Instant); if (lhs instanceof Instant) { date = (Instant) lhs; period = (TemporalAmount) rhs;