Skip to content

Commit 928738e

Browse files
authored
LayoutEncodingAdapter::build doesn't need to panic, it can error (#8824)
Those panics look like an omission
1 parent 10b8173 commit 928738e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

vortex-layout/src/encoding.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use vortex_array::DeserializeMetadata;
1111
use vortex_array::dtype::DType;
1212
use vortex_error::VortexExpect;
1313
use vortex_error::VortexResult;
14-
use vortex_error::vortex_panic;
14+
use vortex_error::vortex_bail;
1515
use vortex_session::registry::Id;
1616

1717
use crate::IntoLayout;
@@ -88,14 +88,14 @@ impl<V: VTable> LayoutEncoding for LayoutEncodingAdapter<V> {
8888

8989
// Validate that the builder function returned the expected values.
9090
if layout.row_count() != row_count {
91-
vortex_panic!(
91+
vortex_bail!(
9292
"Layout row count mismatch: {} != {}",
9393
layout.row_count(),
9494
row_count
9595
);
9696
}
9797
if layout.dtype() != dtype {
98-
vortex_panic!("Layout dtype mismatch: {} != {}", layout.dtype(), dtype);
98+
vortex_bail!("Layout dtype mismatch: {} != {}", layout.dtype(), dtype);
9999
}
100100

101101
Ok(layout.into_layout())

0 commit comments

Comments
 (0)