pitrou commented on code in PR #50166:
URL: https://github.com/apache/arrow/pull/50166#discussion_r3412052438
##########
cpp/src/arrow/array/array_binary_test.cc:
##########
@@ -403,6 +403,14 @@ TEST(StringViewArray, Validate) {
}),
Ok());
+ // Variadic buffer slots, when present, must contain real buffers.
+ EXPECT_THAT(MakeBinaryViewArray({nullptr},
+ {
+ util::ToInlineBinaryView("hello"),
+ util::ToInlineBinaryView("world"),
+ }),
+ Raises(StatusCode::Invalid));
Review Comment:
Can we test the error message somehow?
##########
cpp/src/arrow/c/bridge_test.cc:
##########
@@ -930,6 +930,22 @@ TEST_F(TestArrayExport, PrimitiveSliced) {
TestPrimitive(factory);
}
+TEST_F(TestArrayExport, RejectNullVariadicBuffers) {
+ for (const auto& type : {binary_view(), utf8_view()}) {
+ auto arr =
+ MakeArray(ArrayData::Make(type, /*length=*/2,
+ {nullptr,
+
Buffer::FromVector(std::vector<BinaryViewType::c_type>{
+ util::ToInlineBinaryView("hello"),
+ util::ToInlineBinaryView("world"),
+ }),
+ nullptr}));
+
+ struct ArrowArray c_export;
+ ASSERT_RAISES(Invalid, ExportArray(*arr, &c_export));
Review Comment:
Can we test the error message too?
--
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]