milesgranger commented on code in PR #14749:
URL: https://github.com/apache/arrow/pull/14749#discussion_r1034395351
##########
cpp/src/arrow/compute/kernels/scalar_nested_test.cc:
##########
@@ -168,6 +173,20 @@ TEST(TestScalarNested, ListSliceFixedOutput) {
expected = ArrayFromJSON(fixed_size_list(value_type, 2),
"[[3, null], [null, null], [null, null],
null]");
CheckScalarUnary("list_slice", input, expected, &args);
+
+ args.start = 1;
+ args.stop = std::nullopt;
+ expected = ArrayFromJSON(fixed_size_list(value_type, 2),
+ "[[2, 3], [5, null], [null, null], null]");
+ if (input->type()->id() == Type::FIXED_SIZE_LIST) {
+ CheckScalarUnary("list_slice", input, expected, &args);
+ } else {
+ EXPECT_RAISES_WITH_MESSAGE_THAT(
+ NotImplemented,
+ ::testing::HasSubstr("Unable to produce FixedSizeListArray from "
+ "non-FixedSizeListArray without `stop` being
set."),
+ CallFunction("list_slice", {input}, &args));
+ }
Review Comment:
That can indeed be possible, and a nice extra test case. Thank you!
--
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]