js8544 commented on code in PR #36204:
URL: https://github.com/apache/arrow/pull/36204#discussion_r1245037013
##########
cpp/src/arrow/compute/kernels/scalar_set_lookup_test.cc:
##########
@@ -126,25 +126,40 @@ TEST_F(TestIsInKernel, ImplicitlyCastValueSet) {
"true, false, true, false]"));
AssertArraysEqual(*expected, *out.make_array());
- // fails; value_set cannot be cast to int8
- opts = SetLookupOptions{ArrayFromJSON(float32(), "[2.5, 3.1, 5.0]")};
- ASSERT_RAISES(Invalid, CallFunction("is_in", {input}, &opts));
+ // value_set cannot be casted to int8, but int8 is castable to float
+ CheckIsIn(input, ArrayFromJSON(float32(), "[1.0, 2.5, 3.1, 5.0]"),
+ "[false, true, false, false, false, true, false, false, false]");
// Allow implicit casts between binary types...
CheckIsIn(ArrayFromJSON(binary(), R"(["aaa", "bbb", "ccc", null, "bbb"])"),
ArrayFromJSON(fixed_size_binary(3), R"(["aaa", "bbb"])"),
"[true, true, false, false, true]");
+ CheckIsIn(ArrayFromJSON(fixed_size_binary(3), R"(["aaa", "bbb", "ccc", null,
"bbb"])"),
+ ArrayFromJSON(binary(), R"(["aaa", "bbb"])"),
+ "[true, true, false, false, true]");
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]