influxdb-client 1.17.0.pre.3024 → 1.17.0.pre.3057

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3c00b85066bf6f6d4043e66fd9747633b2ad20e92ea5e9683e00d33ca77a035
4
- data.tar.gz: 2d109a3a326aab34d512cc8a93565e15b35ea7958af021492afce78f63362019
3
+ metadata.gz: e4f12063509fd3861477864642d6b4b503eba1dd3b7a9b7275418c5ab822d7ba
4
+ data.tar.gz: f0a20d494b90a9ba060a70a2e0eeed87687c71f6dc452221c961a2992b91be9e
5
5
  SHA512:
6
- metadata.gz: 1a94053a10547a696297576832a79986e38804d5acd77db0a46821689f4cd10ec6da33b1ab8c7152ce560608283722af4e235cdb5a8f695ba8baeb4da49421e7
7
- data.tar.gz: 0a303636ce48ffe795a4369c80fbf3f6c87fc7786186fc0cbdb5ec5d228a3766ee3ebf7e941e77f16445d56307765f39d9258c0643e92dcdea7249865382bb88
6
+ metadata.gz: cdccbe7ac5487b6e1bbe4826791a91664f5287c73caadfbabdf52a1ca2afd87444bb205efbf4c2a8dde26d486c0b54833a0dc90284e7f1e164f4369800d1d581
7
+ data.tar.gz: 3a9f584d12e8d82e1a0c038c994e96d823c61eac1c0b8dffce82ee5387ced7374c4b5721b86777577e8dc89711a4833681122e8ad33fcee5a46d11f658e853fa
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## 1.17.0 [unreleased]
2
2
 
3
+ ### Bug Fixes
4
+ 1. [#87](https://github.com/influxdata/influxdb-client-ruby/pull/87): Parsing infinite numbers
5
+
3
6
  ## 1.16.0 [2021-07-09]
4
7
 
5
8
  ### Bug Fixes
@@ -240,7 +240,14 @@ module InfluxDB2
240
240
  when 'unsignedLong', 'long', 'duration'
241
241
  str_val.to_i
242
242
  when 'double'
243
- str_val.to_f
243
+ case str_val
244
+ when '+Inf'
245
+ Float::INFINITY
246
+ when '-Inf'
247
+ -Float::INFINITY
248
+ else
249
+ str_val.to_f
250
+ end
244
251
  when 'base64Binary'
245
252
  Base64.decode64(str_val)
246
253
  when 'dateTime:RFC3339', 'dateTime:RFC3339Nano'
@@ -1,4 +1,4 @@
1
- # The MIT License
1
+ # The MIT
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the "Software"), to deal
@@ -166,7 +166,7 @@ class FluxCsvParserTest < MiniTest::Test
166
166
  "#default,mean,,,,,,,,,,,\n" \
167
167
  ",result,table,_start,_stop,_time,_value,_field,_measurement,language,license,name,owner\n" \
168
168
  ',,0,2020-11-02T07:29:49.55050738Z,2020-12-02T07:29:49.55050738Z,2020-11-02T09:00:00Z,9,' \
169
- "stars,github_repository,Ruby,MIT License,influxdb-client-ruby,influxdata\n"
169
+ "stars,gh,Ruby,MIT,influxdb-client-ruby,influxdata\n"
170
170
 
171
171
  tables = InfluxDB2::FluxCsvParser.new(data).parse.tables
172
172
  records = tables[0].records
@@ -464,4 +464,29 @@ class FluxCsvParserErrorTest < MiniTest::Test
464
464
  assert_equal true, tables[0].columns[2].group
465
465
  assert_equal 1, tables[1].records.size
466
466
  end
467
+
468
+ def test_parse_infinity
469
+ data = '#group,false,false,true,true,true,true,true,true,true,true,false,false
470
+ #datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,double,double
471
+ #default,_result,,,,,,,,,,,
472
+ ,result,table,_start,_stop,_field,_measurement,language,license,name,owner,le,_value
473
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,0,0
474
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,10,0
475
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,20,0
476
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,30,0
477
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,40,0
478
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,50,0
479
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,60,0
480
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,70,0
481
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,80,0
482
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,90,0
483
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,+Inf,15
484
+ ,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,-Inf,15'
485
+
486
+ tables = InfluxDB2::FluxCsvParser.new(data).parse.tables
487
+ assert_equal 1, tables.size
488
+ assert_equal 12, tables[0].records.size
489
+ assert_equal tables[0].records[10].values['le'], Float::INFINITY
490
+ assert_equal tables[0].records[11].values['le'], -Float::INFINITY
491
+ end
467
492
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxdb-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0.pre.3024
4
+ version: 1.17.0.pre.3057
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Bednar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-27 00:00:00.000000000 Z
11
+ date: 2021-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler