Skip to content

Commit

Permalink
Add operation in ArrowNativeTypeOp::neg_check error message (#5944) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhao-gang committed Jul 1, 2024
1 parent a4d2167 commit 6230435
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions arrow-arith/src/numeric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,15 +888,15 @@ mod tests {

test_neg_primitive::<Int32Type>(
&[i32::MIN],
Err("Compute error: Overflow happened on: -2147483648"),
Err("Compute error: Overflow happened on: - -2147483648"),
);
test_neg_primitive::<Int64Type>(
&[i64::MIN],
Err("Compute error: Overflow happened on: -9223372036854775808"),
Err("Compute error: Overflow happened on: - -9223372036854775808"),
);
test_neg_primitive::<DurationSecondType>(
&[i64::MIN],
Err("Compute error: Overflow happened on: -9223372036854775808"),
Err("Compute error: Overflow happened on: - -9223372036854775808"),
);

let r = neg_wrapping(&Int32Array::from(vec![i32::MIN])).unwrap();
Expand All @@ -911,7 +911,7 @@ mod tests {

assert_eq!(
err,
"Compute error: Overflow happened on: -9223372036854775808"
"Compute error: Overflow happened on: - -9223372036854775808"
);

let a = Decimal128Array::from(vec![1, 3, -44, 2, 4])
Expand Down
2 changes: 1 addition & 1 deletion arrow-array/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ macro_rules! native_type_op {
#[inline]
fn neg_checked(self) -> Result<Self, ArrowError> {
self.checked_neg().ok_or_else(|| {
ArrowError::ComputeError(format!("Overflow happened on: {:?}", self))
ArrowError::ComputeError(format!("Overflow happened on: - {:?}", self))
})
}

Expand Down

0 comments on commit 6230435

Please sign in to comment.