From 9fa05e678bffd40c1c57ba5057d210bf8074051c Mon Sep 17 00:00:00 2001 From: comphead Date: Fri, 17 Apr 2026 13:56:17 -0700 Subject: [PATCH] chore: Refine the error message for List to non List cast --- arrow-cast/src/cast/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arrow-cast/src/cast/mod.rs b/arrow-cast/src/cast/mod.rs index c96e7c8f6a14..5f08dcbfc138 100644 --- a/arrow-cast/src/cast/mod.rs +++ b/arrow-cast/src/cast/mod.rs @@ -913,9 +913,9 @@ pub fn cast_with_options( Utf8 => value_to_string::(array, cast_options), LargeUtf8 => value_to_string::(array, cast_options), Utf8View => value_to_string_view(array, cast_options), - _ => Err(ArrowError::CastError( - "Cannot cast list to non-list data types".to_string(), - )), + dt => Err(ArrowError::CastError(format!( + "Cannot cast LIST to non-list data type {dt}" + ))), }, (_, List(to)) => cast_values_to_list::(array, to, cast_options), (_, LargeList(to)) => cast_values_to_list::(array, to, cast_options),