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 +4 -4
- data/lib/google/cloud/bigquery/insert_response.rb +16 -3
- data/lib/google/cloud/bigquery/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dffb04e4a94b05717f6566164b869c15e04f0b2
|
4
|
+
data.tar.gz: 83415097e7bdea60cb20ba85777d2d27f3f5a9d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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
|
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.
|
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-
|
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
|