pitrou commented on code in PR #36266:
URL: https://github.com/apache/arrow/pull/36266#discussion_r1414032793
##########
cpp/src/arrow/compute/kernels/scalar_cast_test.cc:
##########
@@ -2104,6 +2104,15 @@ TEST(Cast, BinaryToString) {
// ARROW-16757: we no longer zero copy, but the contents are equal
ASSERT_NE(invalid_utf8->data()->buffers[1].get(),
strings->data()->buffers[2].get());
ASSERT_TRUE(invalid_utf8->data()->buffers[1]->Equals(*strings->data()->buffers[2]));
+
+ // GH-35901: check that casting a sliced array
+ // when first buffer's data is a `nullptr`
+ auto fixed_array_null = ArrayFromJSON(from_type, "[\"123\", \"245\",
\"345\"]");
+ fixed_array_null = fixed_array_null->Slice(1, 1);
+ fixed_array_null->data()->buffers[0] = std::make_shared<Buffer>(nullptr,
0);
Review Comment:
This seems to produce an invalid array (see CI results). Perhaps you meant
`fixed_array_null->data()->buffers[0] = nullptr`?
--
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]