You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "mkleen (via GitHub)" <gi...@apache.org> on 2026/06/03 11:42:01 UTC
Re: [PR] Improve error message on cast structs [datafusion]
mkleen commented on code in PR #22730:
URL: https://github.com/apache/datafusion/pull/22730#discussion_r3348142761
##########
datafusion/physical-expr/src/expressions/cast.rs:
##########
@@ -50,8 +50,8 @@ const DEFAULT_SAFE_CAST_OPTIONS: CastOptions<'static> = CastOptions {
/// planning-time validation matches runtime validation, enabling fail-fast behavior
/// instead of deferring errors to execution. Handles structs at any nesting level
/// (e.g., `List<Struct>`, `Dictionary<_, Struct>`).
-fn can_cast_named_struct_types(source: &DataType, target: &DataType) -> bool {
- validate_data_type_compatibility("", source, target).is_ok()
+fn can_cast_named_struct_types(source: &DataType, target: &DataType) -> Result<bool> {
+ validate_data_type_compatibility("", source, target).map(|_| true)
Review Comment:
This make sure that the error message is not swallowed here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org