google-cloud-bigquery 1.43.0 → 1.44.0

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: c3c421b6b6ea746282462224af1fde4752ce96d59b1d93b4ab2648c76a3c76a3
4
+ data.tar.gz: 768f7aa713d59c6ab4a235dd25871eba33fdce377bfcc8df6506c9c0d0444a98
5
5
  SHA512:
6
- metadata.gz: 3641715b30ab0897a12fab3b216944d50ae5d9468614bac41a60116470b3f8e948db6d394ff02f9dabebd5dc0a16e3cb3a7d8e0ee03b433740953ec0f5e803ac
7
- data.tar.gz: 76a9ad13b267ea9313213a1ee3e1ad094bfd0ea81831fa0aae0e46e7dcae01443a4b76a04b20703145c7b6eaf76e6b74792358ae31984e0d73b9e1cb41bd9db9
6
+ metadata.gz: 42adc11cd66bd69958627e92bd7914dec94f43bfc5347f8e5a3079d8f6409d260de99e36473ae977c66c4f25e823dd989e1d65525d3c53cf5eac88e9e78c58df
7
+ data.tar.gz: e0e00961fc853a5394d230af5a948803d9c8647101bede0fcc18d03d0d02c65ad0c2a522464dd6653ef9fbbf75db0758e69d29b04d63a0cfa428b65d46aaf736
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 1.44.0 (2023-09-04)
4
+
5
+ #### Features
6
+
7
+ * support BIGQUERY_EMULATOR_HOST env variable for endpoint
8
+
9
+ ### 1.43.1 (2023-05-19)
10
+
11
+ #### Bug Fixes
12
+
13
+ * ensure schema for data parsing ([#21616](https://github.com/googleapis/google-cloud-ruby/issues/21616))
14
+
3
15
  ### 1.43.0 (2023-05-10)
4
16
 
5
17
  #### Features
@@ -479,7 +479,7 @@ module Google
479
479
  def tags
480
480
  ensure_full_data!
481
481
  return nil if @gapi.tags.nil?
482
- @gapi.tags.map { |gapi| Tag.from_gapi(gapi) }
482
+ @gapi.tags.map { |gapi| Tag.from_gapi gapi }
483
483
  end
484
484
 
485
485
  ##
@@ -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.44.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -122,6 +122,9 @@ Google::Cloud.configure.add_config! :bigquery do |config|
122
122
  default_project = Google::Cloud::Config.deferred do
123
123
  ENV["BIGQUERY_PROJECT"]
124
124
  end
125
+ default_endpoint = Google::Cloud::Config.deferred do
126
+ ENV["BIGQUERY_EMULATOR_HOST"]
127
+ end
125
128
  default_creds = Google::Cloud::Config.deferred do
126
129
  Google::Cloud::Config.credentials_from_env(
127
130
  "BIGQUERY_CREDENTIALS", "BIGQUERY_CREDENTIALS_JSON", "BIGQUERY_KEYFILE", "BIGQUERY_KEYFILE_JSON"
@@ -136,5 +139,5 @@ Google::Cloud.configure.add_config! :bigquery do |config|
136
139
  config.add_field! :quota_project, nil, match: String
137
140
  config.add_field! :retries, nil, match: Integer
138
141
  config.add_field! :timeout, nil, match: Integer
139
- config.add_field! :endpoint, nil, match: String
142
+ config.add_field! :endpoint, default_endpoint, match: String
140
143
  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.44.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: 2023-05-15 00:00:00.000000000 Z
12
+ date: 2023-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  - !ruby/object:Gem::Version
322
322
  version: '0'
323
323
  requirements: []
324
- rubygems_version: 3.4.2
324
+ rubygems_version: 3.4.19
325
325
  signing_key:
326
326
  specification_version: 4
327
327
  summary: API Client library for Google BigQuery