NickCrews commented on code in PR #43782: URL: https://github.com/apache/arrow/pull/43782#discussion_r1945843120
########## cpp/src/arrow/compute/kernels/scalar_cast_test.cc: ########## @@ -2964,28 +2964,31 @@ TEST(Cast, StructToDifferentNullabilityStruct) { const auto dest1_non_nullable = arrow::struct_(fields_dest1_non_nullable); const auto options1_non_nullable = CastOptions::Safe(dest1_non_nullable); EXPECT_RAISES_WITH_MESSAGE_THAT( - TypeError, - ::testing::HasSubstr("cannot cast nullable field to non-nullable field"), + Invalid, + ::testing::HasSubstr( + "field 'a' has nulls. Can't cast to non-nullable type int64"), Cast(src_nullable, options1_non_nullable)); std::vector<std::shared_ptr<Field>> fields_dest2_non_nullable = { std::make_shared<Field>("a", int64(), false), std::make_shared<Field>("c", int64(), false)}; const auto dest2_non_nullable = arrow::struct_(fields_dest2_non_nullable); - const auto options2_non_nullable = CastOptions::Safe(dest2_non_nullable); + const auto options2_non_nullable = CastOptions::Unsafe(dest2_non_nullable); Review Comment: Thanks, you're right, I'm not sure why I had this change, maybe it wasn't passing in some earlier version of this changeset unless I had it. But it now works just fine with Safe, so reverting to that. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org