google-cloud-bigquery 1.51.0 → 1.51.1

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: 2ea31e3ba9fb9234a89f1e1a25cf514087b01f6f116b7e5529408a09fd084a0d
4
- data.tar.gz: 0444a72e4486d9dc3b736b8a8007e207ee37f6399e32116d4c974d58c14ed7bc
3
+ metadata.gz: 22622b84cc452512e75c5ac091f5e71984f0832756f019c4db07b7a65630548d
4
+ data.tar.gz: 80e428c51bac81fcd01a5cd05be6524fadfede36242f6d0803aa20eaa00c3529
5
5
  SHA512:
6
- metadata.gz: 0ecdff16e754acc36a3c04231f54e101cfe21adda9b3be0978c802a859c3919fa4a54c72e62e3f76ee1c6de6c25164c6e3e5bf8d43111ac20c7bbe4e85247c44
7
- data.tar.gz: 7f7ce9cffb5df5ae50bee4d17b62897a4e55f12521cf7792b4ba54c35d62bd5fc750dacc40d93949f22bb8cbe93286b8ec1f939d94d4ccf101ec524d7a08a656
6
+ metadata.gz: 321176420b19fc2ffc9f49deb73d0445835d8a89842e82fb9f63d3420332ce6f93a9d3c17cc4fb601d11721dd998268214ef39e7fd9eedda17e6afd1fcf9e973
7
+ data.tar.gz: f16ab1999e2a3b8aeeb79072c7cbe36db0388550a11c0afed6a1774a6bcda02a9aba72f45ddb29cced5520a804008248b1656f3ddd92320c40b35590da623972
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 1.51.1 (2024-12-13)
4
+
5
+ #### Bug Fixes
6
+
7
+ * Allow inserts to a target dataset/table in another project ([#28097](https://github.com/googleapis/google-cloud-ruby/issues/28097))
8
+
3
9
  ### 1.51.0 (2024-12-04)
4
10
 
5
11
  #### Features
@@ -2810,7 +2810,7 @@ module Google
2810
2810
  ensure_service!
2811
2811
 
2812
2812
  # Get table, don't use Dataset#table which handles NotFoundError
2813
- gapi = service.get_table dataset_id, table_id, metadata_view: view
2813
+ gapi = service.get_project_table project_id, dataset_id, table_id, metadata_view: view
2814
2814
  table = Table.from_gapi gapi, service, metadata_view: view
2815
2815
  # Get the AsyncInserter from the table
2816
2816
  table.insert_async skip_invalid: skip_invalid,
@@ -2865,7 +2865,8 @@ module Google
2865
2865
  ensure_service!
2866
2866
  gapi = service.insert_tabledata dataset_id, table_id, rows, skip_invalid: skip_invalid,
2867
2867
  ignore_unknown: ignore_unknown,
2868
- insert_ids: insert_ids
2868
+ insert_ids: insert_ids,
2869
+ project_id: project_id
2869
2870
  InsertResponse.from_gapi rows, gapi
2870
2871
  end
2871
2872
 
@@ -257,15 +257,17 @@ module Google
257
257
  end
258
258
  end
259
259
 
260
- def insert_tabledata dataset_id, table_id, rows, insert_ids: nil, ignore_unknown: nil, skip_invalid: nil
260
+ def insert_tabledata dataset_id, table_id, rows, insert_ids: nil, ignore_unknown: nil,
261
+ skip_invalid: nil, project_id: nil
261
262
  json_rows = Array(rows).map { |row| Convert.to_json_row row }
262
263
  insert_tabledata_json_rows dataset_id, table_id, json_rows, insert_ids: insert_ids,
263
264
  ignore_unknown: ignore_unknown,
264
- skip_invalid: skip_invalid
265
+ skip_invalid: skip_invalid,
266
+ project_id: project_id
265
267
  end
266
268
 
267
269
  def insert_tabledata_json_rows dataset_id, table_id, json_rows, insert_ids: nil, ignore_unknown: nil,
268
- skip_invalid: nil
270
+ skip_invalid: nil, project_id: nil
269
271
  rows_and_ids = Array(json_rows).zip Array(insert_ids)
270
272
  insert_rows = rows_and_ids.map do |json_row, insert_id|
271
273
  if insert_id == :skip
@@ -286,9 +288,10 @@ module Google
286
288
  }.to_json
287
289
 
288
290
  # The insertAll with insertId operation is considered idempotent
291
+ project_id ||= @project
289
292
  execute backoff: true do
290
293
  service.insert_all_table_data(
291
- @project, dataset_id, table_id, insert_req,
294
+ project_id, dataset_id, table_id, insert_req,
292
295
  options: { skip_serialization: true }
293
296
  )
294
297
  end
@@ -294,7 +294,8 @@ module Google
294
294
  json_rows,
295
295
  skip_invalid: @skip_invalid,
296
296
  ignore_unknown: @ignore_unknown,
297
- insert_ids: insert_ids
297
+ insert_ids: insert_ids,
298
+ project_id: @table.project_id
298
299
 
299
300
  result = Result.new InsertResponse.from_gapi(orig_rows, insert_resp)
300
301
  rescue StandardError => e
@@ -2747,7 +2747,8 @@ module Google
2747
2747
  rows,
2748
2748
  skip_invalid: skip_invalid,
2749
2749
  ignore_unknown: ignore_unknown,
2750
- insert_ids: insert_ids
2750
+ insert_ids: insert_ids,
2751
+ project_id: project_id
2751
2752
  InsertResponse.from_gapi rows, gapi
2752
2753
  end
2753
2754
 
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigquery
19
- VERSION = "1.51.0".freeze
19
+ VERSION = "1.51.1".freeze
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: 1.51.0
4
+ version: 1.51.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: 2024-12-04 00:00:00.000000000 Z
12
+ date: 2024-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bigdecimal
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubygems_version: 3.5.22
192
+ rubygems_version: 3.5.23
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: API Client library for Google BigQuery