Skip to content

Commit

Permalink
Update CheckListCastError function to remove from_type argument
Browse files Browse the repository at this point in the history
  • Loading branch information
llama90 committed Jan 1, 2024
1 parent 5d33359 commit b7832ab
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cpp/src/arrow/scalar_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1090,14 +1090,13 @@ void CheckListCast(const ScalarType& scalar, const std::shared_ptr<DataType>& to

template <typename ScalarType>
void CheckListCastError(const ScalarType& scalar,
const std::shared_ptr<DataType>& from_type,
const std::shared_ptr<DataType>& 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;
Expand Down Expand Up @@ -1195,7 +1194,7 @@ class TestListLikeScalar : public ::testing::Test {
scalar, fixed_size_list(value_->type(), static_cast<int32_t>(value_->length())));

auto invalid_cast_type = fixed_size_list(value_->type(), 5);
CheckListCastError(scalar, type_, invalid_cast_type);
CheckListCastError(scalar, invalid_cast_type);
}

protected:
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b7832ab

Please sign in to comment.