diff --git a/crates/polars-core/src/chunked_array/temporal/duration.rs b/crates/polars-core/src/chunked_array/temporal/duration.rs index d17eb9a9df1f..32e8b06cb331 100644 --- a/crates/polars-core/src/chunked_array/temporal/duration.rs +++ b/crates/polars-core/src/chunked_array/temporal/duration.rs @@ -73,9 +73,12 @@ impl DurationChunked { }); Ok(out) }, - _ => Err(PolarsError::InvalidOperation( - format!("format {:?} not supported for Duration type (expected one of 'iso' or 'polars')", format).into(), - )), + _ => { + polars_bail!( + InvalidOperation: "format {:?} not supported for Duration type (expected one of 'iso' or 'polars')", + format + ) + }, } }