Skip to content

Commit f27b3e0

Browse files
avoid panic, return error
1 parent 65702b7 commit f27b3e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/storage/field_stats.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ pub async fn calculate_field_stats(
8585
let table_name = Ulid::new().to_string();
8686
ctx.register_parquet(
8787
&table_name,
88-
parquet_path.to_str().expect("valid path"),
88+
parquet_path
89+
.to_str()
90+
.ok_or_else(|| PostError::Invalid(anyhow::anyhow!("Invalid UTF-8 in path")))?,
8991
ParquetReadOptions::default(),
9092
)
9193
.await

0 commit comments

Comments
 (0)