Skip to content

Commit

Permalink
fix: unwrapping Err(DataFusionError::Plan) for use in plan_datafusion…
Browse files Browse the repository at this point in the history
…_err
  • Loading branch information
avkirilishin committed Jan 3, 2025
1 parent 66e4d00 commit d8193e6
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions datafusion/expr/src/expr_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use arrow::compute::can_cast_types;
use arrow::datatypes::{DataType, Field};
use datafusion_common::{
not_impl_err, plan_datafusion_err, plan_err, Column, ExprSchema, Result,
TableReference,
TableReference, DataFusionError,
};
use datafusion_functions_window_common::field::WindowUDFFieldArgs;
use std::collections::HashMap;
Expand Down Expand Up @@ -156,7 +156,10 @@ impl ExprSchemable for Expr {
.map_err(|err| {
plan_datafusion_err!(
"{} {}",
err,
match err {
DataFusionError::Plan(msg) => msg,
err => err.to_string(),
},
utils::generate_signature_error_msg(
func.name(),
func.signature().clone(),
Expand All @@ -181,7 +184,10 @@ impl ExprSchemable for Expr {
.map_err(|err| {
plan_datafusion_err!(
"{} {}",
err,
match err {
DataFusionError::Plan(msg) => msg,
err => err.to_string(),
},
utils::generate_signature_error_msg(
func.name(),
func.signature().clone(),
Expand Down Expand Up @@ -485,7 +491,10 @@ impl Expr {
.map_err(|err| {
plan_datafusion_err!(
"{} {}",
err,
match err {
DataFusionError::Plan(msg) => msg,
err => err.to_string(),
},
utils::generate_signature_error_msg(
fun.name(),
fun.signature(),
Expand All @@ -504,7 +513,10 @@ impl Expr {
data_types_with_window_udf(&data_types, udwf).map_err(|err| {
plan_datafusion_err!(
"{} {}",
err,
match err {
DataFusionError::Plan(msg) => msg,
err => err.to_string(),
},
utils::generate_signature_error_msg(
fun.name(),
fun.signature(),
Expand Down

0 comments on commit d8193e6

Please sign in to comment.