google-cloud-bigquery 0.27.0 → 0.27.1

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
  SHA1:
3
- metadata.gz: 1efd6a85955173b9194de996101ba92b393bebc2
4
- data.tar.gz: 8c246d8d436bb637d1b848f860c0bcf674b1bb47
3
+ metadata.gz: 9dffb04e4a94b05717f6566164b869c15e04f0b2
4
+ data.tar.gz: 83415097e7bdea60cb20ba85777d2d27f3f5a9d1
5
5
  SHA512:
6
- metadata.gz: 39a385146545138ce4d0458b18a4a226a12090e38b1a61c0fd0fc8b942e0fb70a27258d96f54cc687cfe96c6dd429d0c8341a92bee55029b1747a94da3ea3094
7
- data.tar.gz: 83facb29e66f5add2f152ae1d070b1be1899662756d5eedcb6c1529b2308fa09495687c1527582ccd94dd3dbe43cf93c9ca4651b1eae084f33bb992d9ba2d3ad
6
+ metadata.gz: 7a43d0d3b506a8f60e7338c2a0384c2a3b664372559b43bb78ec31119e1c7b438913b47f4255748a676368b86b19bd58d5a83d2d3cdd439e5258ccd8ba9a85e9
7
+ data.tar.gz: 13480d4bc9582e5a46b061d470e8d4f9e058de07af8e0128f07c5b83ab26bc0f9987f5e8ef54fcf152031fd7b7ede7f3061fd069743216f95ade4dde30334024
@@ -43,7 +43,7 @@ module Google
43
43
  Array(@gapi.insert_errors).map do |ie|
44
44
  row = @rows[ie.index]
45
45
  errors = ie.errors.map { |e| JSON.parse e.to_json }
46
- InsertError.new row, errors
46
+ InsertError.new ie.index, row, errors
47
47
  end
48
48
  end
49
49
 
@@ -53,12 +53,23 @@ module Google
53
53
  end
54
54
  end
55
55
 
56
+ def insert_error_for row
57
+ json_row = Convert.to_json_row(row)
58
+ insert_errors.detect { |e| e.row == json_row }
59
+ end
60
+
56
61
  def errors_for row
57
- ie = insert_errors.detect { |e| e.row == row }
62
+ ie = insert_error_for row
58
63
  return ie.errors if ie
59
64
  []
60
65
  end
61
66
 
67
+ def index_for row
68
+ ie = insert_error_for row
69
+ return ie.index if ie
70
+ nil
71
+ end
72
+
62
73
  # @private New InsertResponse from the inserted rows and a
63
74
  # Google::Apis::BigqueryV2::InsertAllTableDataResponse object.
64
75
  def self.from_gapi rows, gapi
@@ -68,11 +79,13 @@ module Google
68
79
  ##
69
80
  # InsertError
70
81
  class InsertError
82
+ attr_reader :index
71
83
  attr_reader :row
72
84
  attr_reader :errors
73
85
 
74
86
  # @private
75
- def initialize row, errors
87
+ def initialize index, row, errors
88
+ @index = index
76
89
  @row = row
77
90
  @errors = errors
78
91
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigquery
19
- VERSION = "0.27.0"
19
+ VERSION = "0.27.1"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-28 00:00:00.000000000 Z
12
+ date: 2017-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core