|
24 | 24 | crate::bench_run::run_with_setup, |
25 | 25 | crate::utils::parquet::convert_utf8view_batch, |
26 | 26 | crate::utils::parquet::convert_utf8view_schema, |
| 27 | + anyhow::Context, |
27 | 28 | arrow_array::RecordBatch, |
28 | 29 | parking_lot::Mutex, |
29 | 30 | std::fs, |
@@ -131,9 +132,7 @@ pub fn benchmark_vortex_decompress( |
131 | 132 | bench_name: &str, |
132 | 133 | ) -> Result<(Duration, CompressionTimingMeasurement)> { |
133 | 134 | let mut buf = Vec::new(); |
134 | | - runtime |
135 | | - .block_on(vortex_compress_write(uncompressed, &mut buf)) |
136 | | - .expect("Failed to compress with vortex for decompression test"); |
| 135 | + runtime.block_on(vortex_compress_write(uncompressed, &mut buf))?; |
137 | 136 | let buffer = Bytes::from(buf); |
138 | 137 |
|
139 | 138 | // Run the benchmark and measure time. |
@@ -255,7 +254,7 @@ pub fn benchmark_lance_compress( |
255 | 254 | .collect::<Result<Vec<_>, _>>()?; |
256 | 255 | let converted_schema = convert_utf8view_schema(&schema); |
257 | 256 |
|
258 | | - let temp_dir = tempfile::tempdir().expect("Failed to create temp dir"); |
| 257 | + let temp_dir = tempfile::tempdir().context("Failed to create temp dir")?; |
259 | 258 | let iteration_paths: Arc<Mutex<Vec<PathBuf>>> = Arc::new(Mutex::new(Vec::new())); |
260 | 259 | let iteration_counter = AtomicU64::new(0); |
261 | 260 |
|
@@ -289,7 +288,7 @@ pub fn benchmark_lance_compress( |
289 | 288 | // Calculate size from the last iteration. |
290 | 289 | let paths = iteration_paths.lock(); |
291 | 290 | let lance_compressed_size_val = if let Some(last_path) = paths.last() { |
292 | | - calculate_lance_size(last_path).expect("Failed to calculate Lance size") |
| 291 | + calculate_lance_size(last_path).context("Failed to calculate Lance size")? |
293 | 292 | } else { |
294 | 293 | 0 |
295 | 294 | }; |
@@ -320,7 +319,7 @@ pub fn benchmark_lance_decompress( |
320 | 319 | // NOTE: Lance requires filesystem access unlike Parquet/Vortex which use in-memory buffers. |
321 | 320 | let chunked = uncompressed.as_::<ChunkedVTable>().clone(); |
322 | 321 | let (batches, schema) = chunked_to_vec_record_batch(chunked); |
323 | | - let temp_dir = tempfile::tempdir().expect("Failed to create temp dir"); |
| 322 | + let temp_dir = tempfile::tempdir().context("Failed to create temp dir")?; |
324 | 323 |
|
325 | 324 | // Write the Lance dataset once for all iterations. |
326 | 325 | let dataset_path = runtime.block_on(async { |
|
0 commit comments