MCPcopy Create free account
hub / github.com/apache/arrow / CheckListCastError

Function CheckListCastError

cpp/src/arrow/scalar_test.cc:1337–1355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1335
1336template <typename ScalarType>
1337void CheckListCastError(const ScalarType& scalar,
1338 const std::shared_ptr<DataType>& to_type) {
1339 StatusCode code;
1340 std::string expected_message;
1341 if (scalar.type->id() == Type::FIXED_SIZE_LIST) {
1342 code = StatusCode::TypeError;
1343 expected_message =
1344 "Size of FixedSizeList is not the same. input list: " + scalar.type->ToString() +
1345 " output list: " + to_type->ToString();
1346 } else {
1347 code = StatusCode::Invalid;
1348 expected_message =
1349 "ListType can only be casted to FixedSizeListType if the lists are all the "
1350 "expected size.";
1351 }
1352
1353 EXPECT_RAISES_WITH_CODE_AND_MESSAGE_THAT(code, ::testing::HasSubstr(expected_message),
1354 Cast(scalar, to_type));
1355}
1356
1357template <typename T>
1358class TestListLikeScalar : public ::testing::Test {

Callers 2

TestCastMethod · 0.85
TESTFunction · 0.85

Calls 3

CastFunction · 0.85
idMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected