Skip to content

Commit

Permalink
[c++] Fail earlier if n_buffers is not as expeced (#3107)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl authored Oct 1, 2024
1 parent c7c33c9 commit e2d1679
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libtiledbsoma/src/utils/arrow_adapter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,13 @@ ArrowAdapter::to_arrow(std::shared_ptr<ColumnBuffer> column) {
array->n_buffers,
column->is_nullable()));

if (array->n_buffers != n_buffers) {
throw TileDBSOMAError(fmt::format(
"[ArrowAdapter] expected array n_buffers {}; got {}",
n_buffers,
array->n_buffers));
}

// After allocating and initializing via nanoarrow we
// hook our custom release function in
array->release = &release_array;
Expand Down

0 comments on commit e2d1679

Please sign in to comment.