influxdb-client 2.8.0 → 2.9.0.pre.6293

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: 3054e7e6bd28c8215d53453169520b24b4b7f93028f292a38c386a17075254b3
4
- data.tar.gz: 8bf55bcb6edc10435a5c154dc490fa50aee3f106da5e8e539a70dc38bc462dfd
3
+ metadata.gz: 3763d8989955e67be855bd1a9aa76c1a3855b45252983a282b2711626a798c35
4
+ data.tar.gz: 3e7634977e521e98f6a3db54e52385bc809f1841da8309c99508e9a3c3a5f263
5
5
  SHA512:
6
- metadata.gz: a3dca177f11e0f80c0d9e51a1899104b2265637c3d64f339c05466d4330c8471cdf881ac0feb68d1151cce6197b99f146f731da431c0aef9f8eda0cba3aed45f
7
- data.tar.gz: f0dff79d02443fcd7f51991409264ce1732fcab2181be12a6d848d65e04c3d7607056c7c2900e1b786123208910a4744aabecd774fe9ee67c03cbd7067929067
6
+ metadata.gz: c7760b125d3b9a3753ac3fcbedb091f13e6b393454f34ba2d42fba8f1828164cf16d6a7c6c8816bb7f455e178c2002d2c1ad435f0457b85b139939f76a6a3c16
7
+ data.tar.gz: '01904b82d64c3689553425dd171da69d8cdb36b6a62135b83f4b5fdea3d1bfc549b395f03094085805f9d0938a1a8a337611d3a5c369b796e70b7c8286e78400'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 2.9.0 [unreleased]
2
+
3
+ ### Bug Fixes
4
+ 1. [#123](https://github.com/influxdata/influxdb-client-ruby/pull/123): Duplicate columns warning shows in improper situations
5
+
1
6
  ## 2.8.0 [2022-10-27]
2
7
 
3
8
  ### Features
@@ -51,7 +51,6 @@ module InfluxDB2
51
51
  # @option options [Logger] :logger Logger used for logging. Disable logging by set to false.
52
52
  # @option options [bool] :debugging Enable debugging for HTTP request/response.
53
53
  # @option options [Hash] :tags Default tags which will be added to each point written by api.
54
- # the body line-protocol
55
54
  def initialize(url, token, options = nil)
56
55
  @auto_closeable = []
57
56
  @options = options ? options.dup : {}
@@ -188,7 +188,7 @@ module InfluxDB2
188
188
  i += 1
189
189
  end
190
190
 
191
- duplicates = table.columns.group_by { :label }.select { |_k, v| v.size > 1 }
191
+ duplicates = table.columns.group_by(&:label).select { |_k, v| v.size > 1 }
192
192
 
193
193
  warning = "The response contains columns with duplicated names: #{duplicates.keys.join(', ')}
194
194
  You should use the 'FluxRecord.row to access your data instead of 'FluxRecord.values' hash."
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module InfluxDB2
22
- VERSION = '2.8.0'.freeze
22
+ VERSION = '2.9.0'.freeze
23
23
  end
@@ -79,7 +79,7 @@ class DeleteApiIntegrationTest < MiniTest::Test
79
79
  @client.create_delete_api.delete(nil, nil)
80
80
  end
81
81
 
82
- assert error.message.include?('invalid request'),
82
+ assert error.message.include?('please format your time with RFC3339Nano'),
83
83
  "Error message: '#{error.message}' doesn't contains 'invalid request'"
84
84
  end
85
85
 
@@ -516,14 +516,44 @@ class FluxCsvParserErrorTest < MiniTest::Test
516
516
  ,,0,2022-09-13T06:14:40.469404272Z,2022-09-13T06:24:40.469404272Z,2022-09-13T06:24:39.299Z,my_measurement,Prague,25.3
517
517
  ,,0,2022-09-13T06:14:40.469404272Z,2022-09-13T06:24:40.469404272Z,2022-09-13T06:24:40.454Z,my_measurement,Prague,25.3'
518
518
 
519
- tables = InfluxDB2::FluxCsvParser.new(data, stream: false, response_mode: InfluxDB2::FluxResponseMode::ONLY_NAMES)
520
- .parse
521
- .tables
522
- assert_equal 1, tables.size
523
- assert_equal 8, tables[0].columns.size
524
- assert_equal 3, tables[0].records.size
525
- assert_equal 7, tables[0].records[0].values.size
526
- assert_equal 8, tables[0].records[0].row.size
527
- assert_equal 25.3, tables[0].records[0].row[7]
519
+ out, = capture_io do
520
+ tables = InfluxDB2::FluxCsvParser.new(data, stream: false, response_mode: InfluxDB2::FluxResponseMode::ONLY_NAMES)
521
+ .parse
522
+ .tables
523
+
524
+ assert_equal 1, tables.size
525
+ assert_equal 8, tables[0].columns.size
526
+ assert_equal 3, tables[0].records.size
527
+ assert_equal 7, tables[0].records[0].values.size
528
+ assert_equal 8, tables[0].records[0].row.size
529
+ assert_equal 25.3, tables[0].records[0].row[7]
530
+ end
531
+
532
+ assert_match 'The response contains columns with duplicated names: result', out
533
+ end
534
+
535
+ def test_parse_without_duplicates
536
+ data = '#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double
537
+ #group,false,false,true,true,false,true,true,false
538
+ #default,_result,,,,,,,
539
+ ,result,table,_start,_stop,_time,_measurement,location,result2
540
+ ,,0,2022-09-13T06:14:40.469404272Z,2022-09-13T06:24:40.469404272Z,2022-09-13T06:24:33.746Z,my_measurement,Prague,25.3
541
+ ,,0,2022-09-13T06:14:40.469404272Z,2022-09-13T06:24:40.469404272Z,2022-09-13T06:24:39.299Z,my_measurement,Prague,25.3
542
+ ,,0,2022-09-13T06:14:40.469404272Z,2022-09-13T06:24:40.469404272Z,2022-09-13T06:24:40.454Z,my_measurement,Prague,25.3'
543
+
544
+ out, = capture_io do
545
+ tables = InfluxDB2::FluxCsvParser.new(data, stream: false, response_mode: InfluxDB2::FluxResponseMode::ONLY_NAMES)
546
+ .parse
547
+ .tables
548
+
549
+ assert_equal 1, tables.size
550
+ assert_equal 8, tables[0].columns.size
551
+ assert_equal 3, tables[0].records.size
552
+ assert_equal 8, tables[0].records[0].values.size
553
+ assert_equal 8, tables[0].records[0].row.size
554
+ assert_equal 25.3, tables[0].records[0].row[7]
555
+ end
556
+
557
+ assert_equal '', out
528
558
  end
529
559
  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: 2.8.0
4
+ version: 2.9.0.pre.6293
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Bednar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-27 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -180,11 +180,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
180
  version: 2.2.0
181
181
  required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - ">="
183
+ - - ">"
184
184
  - !ruby/object:Gem::Version
185
- version: '0'
185
+ version: 1.3.1
186
186
  requirements: []
187
- rubygems_version: 3.0.3.1
187
+ rubygems_version: 3.3.11
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: Ruby library for InfluxDB 2.