google-cloud-spanner 2.12.0 → 2.14.0

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: 45b1fdcea254d6fe805af8a568265615a8d470d383e7792ed7ded88fa02cb8d4
4
- data.tar.gz: e2feec2a70104ff1b423f0d53f9e629308da1c24aec121c99df4a9bd70d5a655
3
+ metadata.gz: 3bd07b2fc95f0e1d07f3e4e7ac3a0b87ad07a5d3037f612688c6c494ba0f6987
4
+ data.tar.gz: 45684d1b7b3ae0d34a551a6469ff130225c238919048ec8e9243020762883520
5
5
  SHA512:
6
- metadata.gz: dbc3e72ccce69115b812ec39e437f968ae5617b5bfcf960bfe8dcfb1e6fd2284fac69db82a2eb855baf129fe3dc8aeb89b69386210fcf767b3325ce05a34f035
7
- data.tar.gz: dadb3ceb9d28b211f54004bac584290c3b5ef3c8b8a20c65a8618362f65b7e9fa940204df49f109ff6a443ba836b934a6cbfa698c314f4a4c66c6478058a033c
6
+ metadata.gz: db4731a786c2af447d557b5f19196fcdd14d19bd98198cdc9ed729d0a15699dfe0b8f36c36f145f99b003be59eafa5887f2ec99193ea3669fba3634dd2b949d5
7
+ data.tar.gz: 0201b3e7eda798bf0f587ec2f8158d374745e44c4904ad4dac7b4546130d4863e22d596fc756a28d8fe5f789ea9e5985bc9db8e1cc54346857f9e937125fa4d9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Release History
2
2
 
3
+ ### 2.14.0 (2022-07-08)
4
+
5
+ #### Features
6
+
7
+ * Updated minimum Ruby version to 2.6 ([#18454](https://github.com/googleapis/google-cloud-ruby/issues/18454))
8
+
9
+ ### 2.13.0 / 2022-04-01
10
+
11
+ #### Features
12
+
13
+ * add spangres support ([#17661](https://www.github.com/googleapis/google-cloud-ruby/issues/17661))
14
+ * add pg_numeric and tests
15
+ * skip test for emulator
16
+ * add rubocop for acceptance
17
+
18
+ ### 2.12.1 / 2022-02-16
19
+
20
+ #### Bug Fixes
21
+
22
+ * pass quota_project_id from credentials
23
+
3
24
  ### 2.12.0 / 2022-01-11
4
25
 
5
26
  No significant changes.
@@ -117,8 +117,11 @@ module Google
117
117
  project_id = project_id.to_s # Always cast to a string
118
118
  raise ArgumentError, "project_id is missing" if project_id.empty?
119
119
 
120
+ configure.quota_project ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
121
+
120
122
  Admin::Database::V1::DatabaseAdmin::Client.new do |config|
121
123
  config.credentials = channel endpoint, credentials
124
+ config.quota_project = configure.quota_project
122
125
  config.timeout = timeout if timeout
123
126
  config.endpoint = endpoint if endpoint
124
127
  config.lib_name = lib_name_with_prefix lib_name, lib_version
@@ -117,8 +117,11 @@ module Google
117
117
  project_id = project_id.to_s # Always cast to a string
118
118
  raise ArgumentError, "project_id is missing" if project_id.empty?
119
119
 
120
+ configure.quota_project ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
121
+
120
122
  Admin::Instance::V1::InstanceAdmin::Client.new do |config|
121
123
  config.credentials = channel endpoint, credentials
124
+ config.quota_project = configure.quota_project
122
125
  config.timeout = timeout if timeout
123
126
  config.endpoint = endpoint if endpoint
124
127
  config.lib_name = lib_name_with_prefix lib_name, lib_version
@@ -174,11 +174,14 @@ module Google
174
174
  def grpc_type_for_field field
175
175
  return field.to_grpc_type if field.respond_to? :to_grpc_type
176
176
 
177
- if Array === field
177
+ case field
178
+ when Array
178
179
  V1::Type.new(
179
180
  code: :ARRAY,
180
181
  array_element_type: grpc_type_for_field(field.first)
181
182
  )
183
+ when :PG_NUMERIC
184
+ V1::Type.new(code: :NUMERIC, type_annotation: :PG_NUMERIC)
182
185
  else
183
186
  V1::Type.new(code: field)
184
187
  end
@@ -172,7 +172,7 @@ module Google
172
172
  def to_h skip_dup_check: nil
173
173
  raise DuplicateNameError if !skip_dup_check && fields.duplicate_names?
174
174
 
175
- Hash[keys.zip to_a(skip_dup_check: skip_dup_check)]
175
+ keys.zip(to_a(skip_dup_check: skip_dup_check)).to_h
176
176
  end
177
177
 
178
178
  # @private
@@ -288,12 +288,9 @@ module Google
288
288
 
289
289
  # @private
290
290
  DATBASE_OPERATION_METADAT_FILTER_TEMPLATE = [
291
- "(metadata.@type:CreateDatabaseMetadata AND " \
292
- "metadata.database:%<database_id>s)",
293
- "(metadata.@type:RestoreDatabaseMetadata AND "\
294
- "metadata.name:%<database_id>s)",
295
- "(metadata.@type:UpdateDatabaseDdl AND "\
296
- "metadata.database:%<database_id>s)"
291
+ "(metadata.@type:CreateDatabaseMetadata AND metadata.database:%<database_id>s)",
292
+ "(metadata.@type:RestoreDatabaseMetadata AND metadata.name:%<database_id>s)",
293
+ "(metadata.@type:UpdateDatabaseDdl AND metadata.database:%<database_id>s)"
297
294
  ].join(" OR ")
298
295
 
299
296
  ##
@@ -331,7 +331,7 @@ module Google
331
331
  #
332
332
  def to_h
333
333
  raise DuplicateNameError if duplicate_names?
334
- Hash[pairs]
334
+ pairs.to_h
335
335
  end
336
336
 
337
337
  # @private
@@ -216,7 +216,7 @@ module Google
216
216
  def labels= labels
217
217
  @grpc.labels = Google::Protobuf::Map.new(
218
218
  :string, :string,
219
- Hash[labels.map { |k, v| [String(k), String(v)] }]
219
+ labels.to_h { |k, v| [String(k), String(v)] }
220
220
  )
221
221
  end
222
222
 
@@ -259,7 +259,7 @@ module Google
259
259
  config = config.path if config.respond_to? :path
260
260
 
261
261
  # Convert from possible Google::Protobuf::Map
262
- labels = Hash[labels.map { |k, v| [String(k), String(v)] }] if labels
262
+ labels = labels.to_h { |k, v| [String(k), String(v)] } if labels
263
263
  grpc = service.create_instance \
264
264
  instance_id, name: name, config: config, nodes: nodes,
265
265
  processing_units: processing_units, labels: labels
@@ -571,7 +571,7 @@ module Google
571
571
  def client instance_id, database_id, pool: {}, labels: nil,
572
572
  query_options: nil
573
573
  # Convert from possible Google::Protobuf::Map
574
- labels = Hash[labels.map { |k, v| [String(k), String(v)] }] if labels
574
+ labels = labels.to_h { |k, v| [String(k), String(v)] } if labels
575
575
  # Configs set by environment variables take over client-level configs.
576
576
  if query_options.nil?
577
577
  query_options = @query_options
@@ -647,7 +647,7 @@ module Google
647
647
  def batch_client instance_id, database_id, labels: nil,
648
648
  query_options: nil
649
649
  # Convert from possible Google::Protobuf::Map
650
- labels = Hash[labels.map { |k, v| [String(k), String(v)] }] if labels
650
+ labels = labels.to_h { |k, v| [String(k), String(v)] } if labels
651
651
  BatchClient.new self, instance_id, database_id, session_labels: labels,
652
652
  query_options: query_options
653
653
  end
@@ -34,13 +34,15 @@ module Google
34
34
  attr_accessor :host
35
35
  attr_accessor :lib_name
36
36
  attr_accessor :lib_version
37
+ attr_accessor :quota_project
37
38
 
38
39
  ##
39
40
  # Creates a new Service instance.
40
- def initialize project, credentials,
41
+ def initialize project, credentials, quota_project: nil,
41
42
  host: nil, timeout: nil, lib_name: nil, lib_version: nil
42
43
  @project = project
43
44
  @credentials = credentials
45
+ @quota_project = quota_project || (credentials.quota_project_id if credentials.respond_to? :quota_project_id)
44
46
  @host = host
45
47
  @timeout = timeout
46
48
  @lib_name = lib_name
@@ -68,6 +70,7 @@ module Google
68
70
  @service ||= \
69
71
  V1::Spanner::Client.new do |config|
70
72
  config.credentials = channel
73
+ config.quota_project = @quota_project
71
74
  config.timeout = timeout if timeout
72
75
  config.endpoint = host if host
73
76
  config.lib_name = lib_name_with_prefix
@@ -82,6 +85,7 @@ module Google
82
85
  @instances ||= \
83
86
  Admin::Instance::V1::InstanceAdmin::Client.new do |config|
84
87
  config.credentials = channel
88
+ config.quota_project = @quota_project
85
89
  config.timeout = timeout if timeout
86
90
  config.endpoint = host if host
87
91
  config.lib_name = lib_name_with_prefix
@@ -96,6 +100,7 @@ module Google
96
100
  @databases ||= \
97
101
  Admin::Database::V1::DatabaseAdmin::Client.new do |config|
98
102
  config.credentials = channel
103
+ config.quota_project = @quota_project
99
104
  config.timeout = timeout if timeout
100
105
  config.endpoint = host if host
101
106
  config.lib_name = lib_name_with_prefix
@@ -130,7 +135,7 @@ module Google
130
135
  processing_units: nil, labels: nil,
131
136
  call_options: nil
132
137
  opts = default_options call_options: call_options
133
- labels = Hash[labels.map { |k, v| [String(k), String(v)] }] if labels
138
+ labels = labels.to_h { |k, v| [String(k), String(v)] } if labels
134
139
 
135
140
  create_obj = Admin::Instance::V1::Instance.new({
136
141
  display_name: name, config: instance_config_path(config),
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Spanner
19
- VERSION = "2.12.0".freeze
19
+ VERSION = "2.14.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -120,7 +120,7 @@ module Google
120
120
 
121
121
  Spanner::Project.new(
122
122
  Spanner::Service.new(
123
- project_id, credentials,
123
+ project_id, credentials, quota_project: configure.quota_project,
124
124
  host: endpoint, timeout: timeout, lib_name: lib_name,
125
125
  lib_version: lib_version
126
126
  ),
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-spanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.14.0
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: 2022-01-11 00:00:00.000000000 Z
12
+ date: 2022-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -87,28 +87,28 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 1.25.1
90
+ version: 1.26.1
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 1.25.1
97
+ version: 1.26.1
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: minitest
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '5.14'
104
+ version: '5.16'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '5.14'
111
+ version: '5.16'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: minitest-autotest
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -326,14 +326,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
326
326
  requirements:
327
327
  - - ">="
328
328
  - !ruby/object:Gem::Version
329
- version: '2.5'
329
+ version: '2.6'
330
330
  required_rubygems_version: !ruby/object:Gem::Requirement
331
331
  requirements:
332
332
  - - ">="
333
333
  - !ruby/object:Gem::Version
334
334
  version: '0'
335
335
  requirements: []
336
- rubygems_version: 3.3.4
336
+ rubygems_version: 3.3.14
337
337
  signing_key:
338
338
  specification_version: 4
339
339
  summary: API Client library for Google Cloud Spanner API