parquet 0.7.0 → 0.7.1

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: c1f3c1598e0557dfbf9ea851624342aa4e04865b3d84c4125617b17e7e3f016a
4
+ data.tar.gz: 00aeec0e5d3db34d6d405492d69ca1f5ba0a6398796fcdce1a7f8676784d3fe9
5
5
  SHA512:
6
- metadata.gz: 7635247bc9627cdafe79ee9be1072c13b0f8ec11549506f9a8b6170d9b095883ede0f8a8165d0340572d89e1501c1d5f144c20f963ab960171dcb5813f15022c
7
- data.tar.gz: abb59172a54c8d63ca39f24bdda4c64b98a60015622fc7f4a7a2a4c42ff03c3327f134de8ec66e006eb38a8cb38da90824a987b44f6e2fcc2af1c01bd4d85ee1
6
+ metadata.gz: 03b488f3cc83e31d8cd9bc61f67c3c7234837c2a0f7f2262b563fdc5094148f66072d3a748a37cda8fc74de8d37f63457d0c5cc63b7f83e6993e0c8f4d504462
7
+ data.tar.gz: 6a11d5c74536784fb96421d3c46da9608e30b77e42adbe60eb43b6fad96750d75b194b7243383bf512f32b0a9af3c10ddc27652bffdcf54b546245a2faa53ac5
@@ -1395,8 +1395,58 @@ 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, but fall back defensively.
1413
+ match f.to_string().parse::<f64>() {
1414
+ Ok(v) => v,
1415
+ Err(e) => {
1416
+ dbg!(e);
1417
+ f as f64
1418
+ } // extremely unlikely
1419
+ }
1420
+ }
1421
+ };
1422
+ Ok(cleaned.into_value_with(&ruby))
1423
+ }
1424
+ ParquetValue::Float32(OrderedFloat(f)) => {
1425
+ let cleaned = {
1426
+ // Fast-path the specials.
1427
+ if f.is_nan() || f.is_infinite() {
1428
+ f as f64
1429
+ } else if f == 0.0 {
1430
+ // Keep the IEEE-754 sign bit for −0.0.
1431
+ if f.is_sign_negative() {
1432
+ -0.0
1433
+ } else {
1434
+ 0.0
1435
+ }
1436
+ } else {
1437
+ // `to_string` gives the shortest exact, round-trippable decimal.
1438
+ // Parsing it back to `f64` cannot fail, but fall back defensively.
1439
+ match f.to_string().parse::<f64>() {
1440
+ Ok(v) => v,
1441
+ Err(e) => {
1442
+ dbg!(e);
1443
+ f as f64
1444
+ } // extremely unlikely
1445
+ }
1446
+ }
1447
+ };
1448
+ Ok(cleaned.into_value_with(&ruby))
1449
+ }
1400
1450
  ParquetValue::Float64(OrderedFloat(f)) => Ok(f.into_value_with(&ruby)),
1401
1451
  ParquetValue::String(s) => Ok(s.into_value_with(&ruby)),
1402
1452
  ParquetValue::Uuid(u) => Ok(u
@@ -1,3 +1,3 @@
1
1
  module Parquet
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
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.1
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