parquet 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de6b7f5c61eb1e796e7066790e2c1e0ada9ba4519140cee4e2378cd402db2586
4
- data.tar.gz: 5b1dc2e442b1be17af82dd3a431b6f3a66254410229055cdbd8713aa1c009be2
3
+ metadata.gz: 26217bfdf85fd24ebfa20f7647d268e493a34951cb8ae5e8d7009029fd728dde
4
+ data.tar.gz: e840e0f7432585477dd1df7839938c4f65b6b4b8325f3edbc0d179aa50240a45
5
5
  SHA512:
6
- metadata.gz: 7635247bc9627cdafe79ee9be1072c13b0f8ec11549506f9a8b6170d9b095883ede0f8a8165d0340572d89e1501c1d5f144c20f963ab960171dcb5813f15022c
7
- data.tar.gz: abb59172a54c8d63ca39f24bdda4c64b98a60015622fc7f4a7a2a4c42ff03c3327f134de8ec66e006eb38a8cb38da90824a987b44f6e2fcc2af1c01bd4d85ee1
6
+ metadata.gz: a48340845a3e679969f3ad235087272b4f3cace61d9cd0ee14673b029a730998c36c5730e9e295cabe7df1fc0d1d5ed8ef673236fba0999d9e1e886eb48f9f84
7
+ data.tar.gz: f4b17962809300fbba73e55479a384efa595754f86e69c7882d7c3e70f41600bfb6a2e2f43a6006b03190e829052a90ee488185d017f22da503dbaf9b80168d2
@@ -1395,8 +1395,46 @@ pub fn parquet_to_ruby(value: ParquetValue) -> Result<Value> {
1395
1395
  ParquetValue::UInt16(i) => Ok((i as u64).into_value_with(&ruby)),
1396
1396
  ParquetValue::UInt32(i) => Ok((i as u64).into_value_with(&ruby)),
1397
1397
  ParquetValue::UInt64(i) => Ok(i.into_value_with(&ruby)),
1398
- ParquetValue::Float16(OrderedFloat(f)) => Ok((f as f64).into_value_with(&ruby)),
1399
- ParquetValue::Float32(OrderedFloat(f)) => Ok((f as f64).into_value_with(&ruby)),
1398
+ ParquetValue::Float16(OrderedFloat(f)) => {
1399
+ let cleaned = {
1400
+ // Fast-path the specials.
1401
+ if f.is_nan() || f.is_infinite() {
1402
+ f as f64
1403
+ } else if f == 0.0 {
1404
+ // Keep the IEEE-754 sign bit for −0.0.
1405
+ if f.is_sign_negative() {
1406
+ -0.0
1407
+ } else {
1408
+ 0.0
1409
+ }
1410
+ } else {
1411
+ // `to_string` gives the shortest exact, round-trippable decimal.
1412
+ // Parsing it back to `f64` cannot fail
1413
+ f.to_string().parse::<f64>()?
1414
+ }
1415
+ };
1416
+ Ok(cleaned.into_value_with(&ruby))
1417
+ }
1418
+ ParquetValue::Float32(OrderedFloat(f)) => {
1419
+ let cleaned = {
1420
+ // Fast-path the specials.
1421
+ if f.is_nan() || f.is_infinite() {
1422
+ f as f64
1423
+ } else if f == 0.0 {
1424
+ // Keep the IEEE-754 sign bit for −0.0.
1425
+ if f.is_sign_negative() {
1426
+ -0.0
1427
+ } else {
1428
+ 0.0
1429
+ }
1430
+ } else {
1431
+ // `to_string` gives the shortest exact, round-trippable decimal.
1432
+ // Parsing it back to `f64` cannot fail
1433
+ f.to_string().parse::<f64>()?
1434
+ }
1435
+ };
1436
+ Ok(cleaned.into_value_with(&ruby))
1437
+ }
1400
1438
  ParquetValue::Float64(OrderedFloat(f)) => Ok(f.into_value_with(&ruby)),
1401
1439
  ParquetValue::String(s) => Ok(s.into_value_with(&ruby)),
1402
1440
  ParquetValue::Uuid(u) => Ok(u
@@ -1,3 +1,3 @@
1
1
  module Parquet
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parquet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Jaremko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-04 00:00:00.000000000 Z
11
+ date: 2025-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys