Skip to content

Commit

Permalink
capture backtraces
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Feb 16, 2025
1 parent be43268 commit 0ffd5a4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions datafusion/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ macro_rules! downcast_value {
// Not public API.
#[doc(hidden)]
pub mod __private {
use super::DataFusionError;
use super::Result;
use crate::error::_internal_datafusion_err;
use crate::Result;
use arrow::array::Array;
use std::any::{type_name, Any};

Expand All @@ -129,11 +129,11 @@ pub mod __private {
impl<T: Array + ?Sized> DowncastArrayHelper for T {
fn downcast_array_helper<U: Any>(&self) -> Result<&U> {
self.as_any().downcast_ref().ok_or_else(|| {
DataFusionError::Internal(format!(
_internal_datafusion_err!(
"could not cast array of type {} to {}",
self.data_type(),
type_name::<U>()
))
)
})
}
}
Expand Down Expand Up @@ -167,7 +167,7 @@ mod tests {
.unwrap();

assert_eq!(
error.to_string(),
error.strip_backtrace(),
"Internal error: could not cast array of type Int32 to arrow_array::array::primitive_array::PrimitiveArray<arrow_array::types::UInt64Type>.\n\
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"
);
Expand Down

0 comments on commit 0ffd5a4

Please sign in to comment.