google-cloud-bigquery 1.43.0 → 1.43.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
  SHA256:
3
- metadata.gz: d5aa7d55d1ed17508170fec706bfaf59a4434dc5ff9fa4a7ba6d3b655d441881
4
- data.tar.gz: 865f6dc6a4a0abfed2c2c89da2a6c1021ca8e1174b6e89418da0807dca854954
3
+ metadata.gz: e27ba48c9cd2221a917650e0499941a061badcd5f5cab2f190dccf6dd16328a0
4
+ data.tar.gz: 51a6d6dde1b54ca6a83ce0826959d129280de0a1cc699a85f95dfb9dc5c18d09
5
5
  SHA512:
6
- metadata.gz: 3641715b30ab0897a12fab3b216944d50ae5d9468614bac41a60116470b3f8e948db6d394ff02f9dabebd5dc0a16e3cb3a7d8e0ee03b433740953ec0f5e803ac
7
- data.tar.gz: 76a9ad13b267ea9313213a1ee3e1ad094bfd0ea81831fa0aae0e46e7dcae01443a4b76a04b20703145c7b6eaf76e6b74792358ae31984e0d73b9e1cb41bd9db9
6
+ metadata.gz: f7f1782907b0e18570146a0bdb5470970ba2c041beeade1509dd6fe3c9ebd03a576db0a14c8e1d34fcdd2456adfbc82e674c86c302f7adaccc63cb278e95108d
7
+ data.tar.gz: b95c3d7ef958259e10fcdb0765d123f5a71043278b6d7e592546940d28b7266dbc3cfa16c5de5bfcfec1ee235d57a7a1bf9060f4eec5b41cc9525e2c7ac42a7a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 1.43.1 (2023-05-19)
4
+
5
+ #### Bug Fixes
6
+
7
+ * ensure schema for data parsing ([#21616](https://github.com/googleapis/google-cloud-ruby/issues/21616))
8
+
3
9
  ### 1.43.0 (2023-05-10)
4
10
 
5
11
  #### Features
@@ -720,7 +720,7 @@ module Google
720
720
  use_legacy_sql: use_legacy_sql,
721
721
  user_defined_function_resources: udfs_gapi(udfs)
722
722
  )
723
- }.delete_if { |_, v| v.nil? }
723
+ }.compact
724
724
  new_view = Google::Apis::BigqueryV2::Table.new(**new_view_opts)
725
725
 
726
726
  gapi = service.insert_table dataset_id, new_view
@@ -794,7 +794,7 @@ module Google
794
794
  query: query,
795
795
  refresh_interval_ms: refresh_interval_ms
796
796
  )
797
- }.delete_if { |_, v| v.nil? }
797
+ }.compact
798
798
  new_view = Google::Apis::BigqueryV2::Table.new(**new_view_opts)
799
799
 
800
800
  gapi = service.insert_table dataset_id, new_view
@@ -2776,7 +2776,7 @@ module Google
2776
2776
  params = {
2777
2777
  dataset: dataset_ref,
2778
2778
  target_types: target_types
2779
- }.delete_if { |_, v| v.nil? }
2779
+ }.compact
2780
2780
  Google::Apis::BigqueryV2::DatasetAccessEntry.new(**params)
2781
2781
  end
2782
2782
 
@@ -748,11 +748,10 @@ module Google
748
748
  def data token: nil, max: nil, start: nil
749
749
  return nil unless done?
750
750
  return Data.from_gapi_json({ rows: [] }, nil, @gapi, service) if dryrun?
751
- if ddl? || dml?
751
+ if ddl? || dml? || !ensure_schema!
752
752
  data_hash = { totalRows: nil, rows: [] }
753
753
  return Data.from_gapi_json data_hash, nil, @gapi, service
754
754
  end
755
- ensure_schema!
756
755
 
757
756
  data_hash = service.list_tabledata destination_table_dataset_id,
758
757
  destination_table_table_id,
@@ -1791,10 +1790,10 @@ module Google
1791
1790
  protected
1792
1791
 
1793
1792
  def ensure_schema!
1794
- return unless destination_schema.nil?
1793
+ return true unless destination_schema.nil?
1795
1794
 
1796
1795
  query_results_gapi = service.job_query_results job_id, location: location, max: 0
1797
- # raise "unable to retrieve schema" if query_results_gapi.schema.nil?
1796
+ return false if query_results_gapi.schema.nil?
1798
1797
  @destination_schema_gapi = query_results_gapi.schema
1799
1798
  end
1800
1799
 
@@ -490,7 +490,7 @@ module Google
490
490
  project_id: m["prj"],
491
491
  dataset_id: m["dts"],
492
492
  table_id: m["tbl"]
493
- }.delete_if { |_, v| v.nil? }
493
+ }.compact
494
494
  str_table_ref_hash = default_ref.to_h.merge str_table_ref_hash
495
495
  ref = Google::Apis::BigqueryV2::TableReference.new(**str_table_ref_hash)
496
496
  validate_table_ref ref
@@ -506,7 +506,7 @@ module Google
506
506
  params = {
507
507
  dataset: Google::Apis::BigqueryV2::DatasetReference.new(**dataset_hash),
508
508
  target_types: dataset_hash[:target_types]
509
- }.delete_if { |_, v| v.nil? }
509
+ }.compact
510
510
  Google::Apis::BigqueryV2::DatasetAccessEntry.new(**params)
511
511
  end
512
512
 
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigquery
19
- VERSION = "1.43.0".freeze
19
+ VERSION = "1.43.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.43.0
4
+ version: 1.43.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: 2023-05-15 00:00:00.000000000 Z
12
+ date: 2023-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby