File tree Expand file tree Collapse file tree
datafusion-federation/src/schema_cast Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -327,15 +327,20 @@ mod test {
327327
328328 let err =
329329 try_cast_to ( batch, target_schema) . expect_err ( "Decimal overflow should return an error" ) ;
330- assert ! (
331- matches!( err, Error :: UnableToCastColumn { .. } ) ,
332- "Expected UnableToCastColumn, got: {err:?}"
333- ) ;
334- let err_msg = err. to_string ( ) ;
335- assert ! (
336- err_msg. contains( "is too large to store in a Decimal128" ) ,
337- "Expected overflow message, got: {err_msg}"
338- ) ;
330+ match & err {
331+ Error :: UnableToCastColumn {
332+ source : arrow_err, ..
333+ } => {
334+ assert ! (
335+ matches!(
336+ arrow_err,
337+ datafusion:: arrow:: error:: ArrowError :: InvalidArgumentError ( _)
338+ ) ,
339+ "Expected InvalidArgumentError, got: {arrow_err:?}"
340+ ) ;
341+ }
342+ other => panic ! ( "Expected UnableToCastColumn, got: {other:?}" ) ,
343+ }
339344 }
340345
341346 /// Casting Decimal128 with values that fit should succeed.
You can’t perform that action at this time.
0 commit comments