Skip to content

Commit

Permalink
Check that bool type is also not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
AlenkaF committed Mar 24, 2024
1 parent a671b07 commit a43dafe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cpp/src/arrow/record_batch_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,19 @@ TEST_F(TestRecordBatch, ToTensorUnsupportedType) {
ASSERT_RAISES_WITH_MESSAGE(
TypeError, "Type error: DataType is not supported: " + a1->type()->ToString(),
batch->ToTensor());

// Unsupported boolean data type
auto f2 = field("f2", boolean());

std::vector<std::shared_ptr<Field>> fields2 = {f0, f2};
auto schema2 = ::arrow::schema(fields2);
auto a2 = ArrayFromJSON(boolean(),
"[true, false, true, true, false, true, false, true, true]");
auto batch2 = RecordBatch::Make(schema2, length, {a0, a2});

ASSERT_RAISES_WITH_MESSAGE(
TypeError, "Type error: DataType is not supported: " + a2->type()->ToString(),
batch2->ToTensor());
}

TEST_F(TestRecordBatch, ToTensorUnsupportedMissing) {
Expand Down

0 comments on commit a43dafe

Please sign in to comment.