Skip to content

Commit 7b7a396

Browse files
committed
fix: borrow decimal values in SQL tests
Decimal formatting only borrows its input. Preserve that ownership contract to satisfy all-feature Clippy checks.
1 parent 29bab9c commit 7b7a396

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

datafusion/sqllogictest/src/engines/conversion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub(crate) fn arrow_decimal_to_str<T: DecimalType>(
9696
}
9797

9898
#[cfg(feature = "postgres")]
99-
pub(crate) fn decimal_to_str(value: BigDecimal) -> String {
99+
pub(crate) fn decimal_to_str(value: &BigDecimal) -> String {
100100
value.to_plain_string()
101101
}
102102

datafusion/sqllogictest/src/engines/postgres_engine/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ fn cell_to_string(row: &SimpleQueryRow, column_type: &Type, idx: usize) -> Strin
377377
(&Type::INT4, Some(value)) => value.parse::<i32>().unwrap().to_string(),
378378
(&Type::INT8, Some(value)) => value.parse::<i64>().unwrap().to_string(),
379379
(&Type::NUMERIC, Some(value)) => {
380-
decimal_to_str(BigDecimal::from_str(value).unwrap())
380+
decimal_to_str(&BigDecimal::from_str(value).unwrap())
381381
}
382382
// Parse date/time strings explicitly to avoid locale-specific formatting.
383383
(&Type::DATE, Some(value)) => NaiveDate::parse_from_str(value, "%Y-%m-%d")

0 commit comments

Comments
 (0)