Skip to content

Commit 449bafe

Browse files
committed
[FIX] fix clippy warnings
1 parent 61fdc9e commit 449bafe

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

parquet-variant/src/encoder/variant_to_json.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ mod tests {
407407

408408
#[test]
409409
fn test_float_to_json() -> Result<(), ArrowError> {
410-
let variant = Variant::Float(3.14159);
410+
let variant = Variant::Float(std::f32::consts::PI);
411411
let json = variant_to_json_string(&variant)?;
412412
assert!(json.starts_with("3.14159"));
413413

@@ -428,7 +428,7 @@ mod tests {
428428

429429
#[test]
430430
fn test_double_to_json() -> Result<(), ArrowError> {
431-
let variant = Variant::Double(2.718281828459045);
431+
let variant = Variant::Double(std::f64::consts::E);
432432
let json = variant_to_json_string(&variant)?;
433433
assert!(json.starts_with("2.718281828459045"));
434434

@@ -852,7 +852,7 @@ mod tests {
852852
list.append_value(42i32);
853853
list.append_value(true);
854854
list.append_value(()); // null
855-
list.append_value(3.14f64);
855+
list.append_value(std::f64::consts::PI);
856856
list.finish();
857857
}
858858

@@ -921,7 +921,7 @@ mod tests {
921921
list.append_value("string_value");
922922
list.append_value(42i32);
923923
list.append_value(true);
924-
list.append_value(3.14f64);
924+
list.append_value(std::f64::consts::PI);
925925
list.append_value(false);
926926
list.append_value(()); // null
927927
list.append_value(100i64);

parquet-variant/tests/integration_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ fn test_integer_types_to_json() {
139139
#[test]
140140
fn test_floating_point_types_to_json() {
141141
// Test Float (f32)
142-
let float_variant = Variant::Float(3.14159);
142+
let float_variant = Variant::Float(std::f32::consts::PI);
143143
let float_json = variant_to_json_string(&float_variant).unwrap();
144144
assert!(float_json.starts_with("3.14159"));
145145

146146
let float_value = variant_to_json_value(&float_variant).unwrap();
147147
assert!(matches!(float_value, Value::Number(_)));
148148

149149
// Test Double (f64)
150-
let double_variant = Variant::Double(2.718281828459045);
150+
let double_variant = Variant::Double(std::f64::consts::E);
151151
let double_json = variant_to_json_string(&double_variant).unwrap();
152152
assert!(double_json.starts_with("2.718281828459045"));
153153

@@ -278,7 +278,7 @@ fn test_comprehensive_roundtrip_compatibility() {
278278
Variant::Int32(100000),
279279
Variant::Int64(10000000000),
280280
Variant::Float(3.5), // Use a value that can be represented exactly in f32
281-
Variant::Double(2.718281828),
281+
Variant::Double(std::f64::consts::E),
282282
Variant::Decimal4 {
283283
integer: 12345,
284284
scale: 2,

0 commit comments

Comments
 (0)