|
22 | 22 | bench_run::run_with_setup, |
23 | 23 | utils::{convert_utf8view_batch, convert_utf8view_schema}, |
24 | 24 | }, |
| 25 | + anyhow::Context, |
25 | 26 | arrow_array::RecordBatch, |
26 | 27 | parking_lot::Mutex, |
27 | 28 | std::fs, |
@@ -126,9 +127,7 @@ pub fn benchmark_vortex_decompress( |
126 | 127 | bench_name: &str, |
127 | 128 | ) -> Result<(Duration, CompressionTimingMeasurement)> { |
128 | 129 | let mut buf = Vec::new(); |
129 | | - runtime |
130 | | - .block_on(vortex_compress_write(uncompressed, &mut buf)) |
131 | | - .expect("Failed to compress with vortex for decompression test"); |
| 130 | + runtime.block_on(vortex_compress_write(uncompressed, &mut buf))?; |
132 | 131 | let buffer = Bytes::from(buf); |
133 | 132 |
|
134 | 133 | // Run the benchmark and measure time. |
@@ -250,7 +249,7 @@ pub fn benchmark_lance_compress( |
250 | 249 | .collect::<Result<Vec<_>, _>>()?; |
251 | 250 | let converted_schema = convert_utf8view_schema(&schema); |
252 | 251 |
|
253 | | - let temp_dir = tempfile::tempdir().expect("Failed to create temp dir"); |
| 252 | + let temp_dir = tempfile::tempdir().context("Failed to create temp dir")?; |
254 | 253 | let iteration_paths: Arc<Mutex<Vec<PathBuf>>> = Arc::new(Mutex::new(Vec::new())); |
255 | 254 | let iteration_counter = AtomicU64::new(0); |
256 | 255 |
|
@@ -284,7 +283,7 @@ pub fn benchmark_lance_compress( |
284 | 283 | // Calculate size from the last iteration. |
285 | 284 | let paths = iteration_paths.lock(); |
286 | 285 | let lance_compressed_size_val = if let Some(last_path) = paths.last() { |
287 | | - calculate_lance_size(last_path).expect("Failed to calculate Lance size") |
| 286 | + calculate_lance_size(last_path).context("Failed to calculate Lance size")? |
288 | 287 | } else { |
289 | 288 | 0 |
290 | 289 | }; |
@@ -315,7 +314,7 @@ pub fn benchmark_lance_decompress( |
315 | 314 | // NOTE: Lance requires filesystem access unlike Parquet/Vortex which use in-memory buffers. |
316 | 315 | let chunked = uncompressed.as_::<ChunkedVTable>().clone(); |
317 | 316 | let (batches, schema) = chunked_to_vec_record_batch(chunked); |
318 | | - let temp_dir = tempfile::tempdir().expect("Failed to create temp dir"); |
| 317 | + let temp_dir = tempfile::tempdir().context("Failed to create temp dir")?; |
319 | 318 |
|
320 | 319 | // Write the Lance dataset once for all iterations. |
321 | 320 | let dataset_path = runtime.block_on(async { |
|
0 commit comments