google-cloud-bigquery 1.53.0 → 1.55.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.
@@ -723,6 +723,8 @@ module Google
723
723
  # identifying the result set.
724
724
  # @param [Integer] max Maximum number of results to return.
725
725
  # @param [Integer] start Zero-based index of the starting row to read.
726
+ # @param [Boolean] format_options_use_int64_timestamp Output timestamp
727
+ # as usec int64. Default is true.
726
728
  #
727
729
  # @return [Google::Cloud::Bigquery::Data] An object providing access to
728
730
  # data read from the destination table for the job.
@@ -745,20 +747,21 @@ module Google
745
747
  # # Retrieve the next page of results
746
748
  # data = data.next if data.next?
747
749
  #
748
- def data token: nil, max: nil, start: nil
750
+ def data token: nil, max: nil, start: nil, format_options_use_int64_timestamp: true
749
751
  return nil unless done?
750
- return Data.from_gapi_json({ rows: [] }, nil, @gapi, service) if dryrun?
752
+ return Data.from_gapi_json({ rows: [] }, nil, @gapi, service, format_options_use_int64_timestamp) if dryrun?
751
753
  if ddl? || dml? || !ensure_schema!
752
754
  data_hash = { totalRows: nil, rows: [] }
753
- return Data.from_gapi_json data_hash, nil, @gapi, service
755
+ return Data.from_gapi_json data_hash, nil, @gapi, service, format_options_use_int64_timestamp
754
756
  end
755
757
 
756
758
  data_hash = service.list_tabledata destination_table_dataset_id,
757
759
  destination_table_table_id,
758
760
  token: token,
759
761
  max: max,
760
- start: start
761
- Data.from_gapi_json data_hash, destination_table_gapi, @gapi, service
762
+ start: start,
763
+ format_options_use_int64_timestamp: format_options_use_int64_timestamp
764
+ Data.from_gapi_json data_hash, destination_table_gapi, @gapi, service, format_options_use_int64_timestamp
762
765
  end
763
766
  alias query_results data
764
767
 
@@ -109,29 +109,29 @@ module Google
109
109
 
110
110
  ##
111
111
  # Returns the dataset specified by datasetID.
112
- def get_dataset dataset_id
113
- get_project_dataset @project, dataset_id
112
+ def get_dataset dataset_id, access_policy_version: nil
113
+ get_project_dataset @project, dataset_id, access_policy_version: access_policy_version
114
114
  end
115
115
 
116
116
  ##
117
117
  # Gets the specified dataset resource by full dataset reference.
118
- def get_project_dataset project_id, dataset_id
118
+ def get_project_dataset project_id, dataset_id, access_policy_version: nil
119
119
  # The get operation is considered idempotent
120
120
  execute backoff: true do
121
- service.get_dataset project_id, dataset_id
121
+ service.get_dataset project_id, dataset_id, access_policy_version: access_policy_version
122
122
  end
123
123
  end
124
124
 
125
125
  ##
126
126
  # Creates a new empty dataset.
127
- def insert_dataset new_dataset_gapi
128
- execute { service.insert_dataset @project, new_dataset_gapi }
127
+ def insert_dataset new_dataset_gapi, access_policy_version: nil
128
+ execute { service.insert_dataset @project, new_dataset_gapi, access_policy_version: access_policy_version }
129
129
  end
130
130
 
131
131
  ##
132
132
  # Updates information in an existing dataset, only replacing
133
133
  # fields that are provided in the submitted dataset resource.
134
- def patch_dataset dataset_id, patched_dataset_gapi
134
+ def patch_dataset dataset_id, patched_dataset_gapi, access_policy_version: nil
135
135
  patch_with_backoff = false
136
136
  options = {}
137
137
  if patched_dataset_gapi.etag
@@ -140,7 +140,8 @@ module Google
140
140
  patch_with_backoff = true
141
141
  end
142
142
  execute backoff: patch_with_backoff do
143
- service.patch_dataset @project, dataset_id, patched_dataset_gapi, options: options
143
+ service.patch_dataset @project, dataset_id, patched_dataset_gapi, options: options,
144
+ access_policy_version: access_policy_version
144
145
  end
145
146
  end
146
147
 
@@ -244,7 +245,8 @@ module Google
244
245
 
245
246
  ##
246
247
  # Retrieves data from the table.
247
- def list_tabledata dataset_id, table_id, max: nil, token: nil, start: nil
248
+ def list_tabledata dataset_id, table_id, max: nil, token: nil, start: nil,
249
+ format_options_use_int64_timestamp: nil
248
250
  # The list operation is considered idempotent
249
251
  execute backoff: true do
250
252
  json_txt = service.list_table_data \
@@ -252,7 +254,8 @@ module Google
252
254
  max_results: max,
253
255
  page_token: token,
254
256
  start_index: start,
255
- options: { skip_deserialization: true }
257
+ options: { skip_deserialization: true },
258
+ format_options_use_int64_timestamp: format_options_use_int64_timestamp
256
259
  JSON.parse json_txt, symbolize_names: true
257
260
  end
258
261
  end
@@ -456,7 +459,8 @@ module Google
456
459
 
457
460
  ##
458
461
  # Returns the query data for the job
459
- def job_query_results job_id, location: nil, max: nil, token: nil, start: nil, timeout: nil
462
+ def job_query_results job_id, location: nil, max: nil, token: nil,
463
+ start: nil, timeout: nil, format_options_use_int64_timestamp: nil
460
464
  # The get operation is considered idempotent
461
465
  execute backoff: true do
462
466
  service.get_job_query_results @project, job_id,
@@ -464,7 +468,8 @@ module Google
464
468
  max_results: max,
465
469
  page_token: token,
466
470
  start_index: start,
467
- timeout_ms: timeout
471
+ timeout_ms: timeout,
472
+ format_options_use_int64_timestamp: format_options_use_int64_timestamp
468
473
  end
469
474
  end
470
475
 
@@ -1701,6 +1701,8 @@ module Google
1701
1701
  #
1702
1702
  # @param [Integer] max Maximum number of results to return.
1703
1703
  # @param [Integer] start Zero-based index of the starting row to read.
1704
+ # @param [Boolean] format_options_use_int64_timestamp Output timestamp
1705
+ # as usec int64. Default is true.
1704
1706
  #
1705
1707
  # @return [Google::Cloud::Bigquery::Data]
1706
1708
  #
@@ -1735,11 +1737,12 @@ module Google
1735
1737
  #
1736
1738
  # @!group Data
1737
1739
  #
1738
- def data token: nil, max: nil, start: nil
1740
+ def data token: nil, max: nil, start: nil, format_options_use_int64_timestamp: true
1739
1741
  ensure_service!
1740
1742
  reload! unless resource_full?
1741
- data_json = service.list_tabledata dataset_id, table_id, token: token, max: max, start: start
1742
- Data.from_gapi_json data_json, gapi, nil, service
1743
+ data_json = service.list_tabledata dataset_id, table_id, token: token, max: max, start: start,
1744
+ format_options_use_int64_timestamp: format_options_use_int64_timestamp
1745
+ Data.from_gapi_json data_json, gapi, nil, service, format_options_use_int64_timestamp
1743
1746
  end
1744
1747
 
1745
1748
  ##
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigquery
19
- VERSION = "1.53.0".freeze
19
+ VERSION = "1.55.0".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.53.0
4
+ version: 1.55.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -134,6 +134,7 @@ files:
134
134
  - lib/google-cloud-bigquery.rb
135
135
  - lib/google/cloud/bigquery.rb
136
136
  - lib/google/cloud/bigquery/argument.rb
137
+ - lib/google/cloud/bigquery/condition.rb
137
138
  - lib/google/cloud/bigquery/convert.rb
138
139
  - lib/google/cloud/bigquery/copy_job.rb
139
140
  - lib/google/cloud/bigquery/credentials.rb