From b7832abd1cfb09fed66deee4f91fe0f24d1e4508 Mon Sep 17 00:00:00 2001 From: Hyunseok Seo Date: Mon, 1 Jan 2024 20:17:11 +0900 Subject: [PATCH] Update CheckListCastError function to remove from_type argument --- cpp/src/arrow/scalar_test.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cpp/src/arrow/scalar_test.cc b/cpp/src/arrow/scalar_test.cc index 654e0510c6f42..8592765adca8f 100644 --- a/cpp/src/arrow/scalar_test.cc +++ b/cpp/src/arrow/scalar_test.cc @@ -1090,14 +1090,13 @@ void CheckListCast(const ScalarType& scalar, const std::shared_ptr& to template void CheckListCastError(const ScalarType& scalar, - const std::shared_ptr& from_type, const std::shared_ptr& to_type) { StatusCode code; std::string expected_message; - if (from_type->id() == Type::FIXED_SIZE_LIST) { + if (scalar.type->id() == Type::FIXED_SIZE_LIST) { code = StatusCode::TypeError; expected_message = - "Size of FixedSizeList is not the same. input list: " + from_type->ToString() + + "Size of FixedSizeList is not the same. input list: " + scalar.type->ToString() + " output list: " + to_type->ToString(); } else { code = StatusCode::Invalid; @@ -1195,7 +1194,7 @@ class TestListLikeScalar : public ::testing::Test { scalar, fixed_size_list(value_->type(), static_cast(value_->length()))); auto invalid_cast_type = fixed_size_list(value_->type(), 5); - CheckListCastError(scalar, type_, invalid_cast_type); + CheckListCastError(scalar, invalid_cast_type); } protected: @@ -1253,7 +1252,7 @@ TEST(TestMapScalar, Cast) { CheckListCast(scalar, fixed_size_list(key_value_type, 2)); auto invalid_cast_type = fixed_size_list(key_value_type, 5); - CheckListCastError(scalar, scalar.type, invalid_cast_type); + CheckListCastError(scalar, invalid_cast_type); } TEST(TestStructScalar, FieldAccess) {