lib/google/cloud/bigquery/service.rb in google-cloud-bigquery-1.10.0 vs lib/google/cloud/bigquery/service.rb in google-cloud-bigquery-1.11.0

- old
+ new

@@ -134,11 +134,11 @@ def list_tables dataset_id, options = {} # The list operation is considered idempotent execute backoff: true do service.list_tables @project, dataset_id, max_results: options[:max], - page_token: options[:token] + page_token: options[:token] end end def get_project_table project_id, dataset_id, table_id # The get operation is considered idempotent @@ -195,13 +195,13 @@ # The list operation is considered idempotent execute backoff: true do json_txt = service.list_table_data \ @project, dataset_id, table_id, max_results: options.delete(:max), - page_token: options.delete(:token), + page_token: options.delete(:token), start_index: options.delete(:start), - options: { skip_deserialization: true } + options: { skip_deserialization: true } JSON.parse json_txt, symbolize_names: true end end def insert_tabledata dataset_id, table_id, rows, options = {} @@ -215,18 +215,18 @@ rows_and_ids = Array(json_rows).zip Array(options[:insert_ids]) insert_rows = rows_and_ids.map do |json_row, insert_id| insert_id ||= SecureRandom.uuid { insertId: insert_id, - json: json_row + json: json_row } end insert_req = { - rows: insert_rows, + rows: insert_rows, ignoreUnknownValues: options[:ignore_unknown], - skipInvalidRows: options[:skip_invalid] + skipInvalidRows: options[:skip_invalid] }.to_json # The insertAll with insertId operation is considered idempotent execute backoff: true do service.insert_all_table_data( @@ -285,17 +285,17 @@ ## # Returns the query data for the job def job_query_results job_id, options = {} # The get operation is considered idempotent execute backoff: true do - service.get_job_query_results @project, - job_id, - location: options.delete(:location), - max_results: options.delete(:max), - page_token: options.delete(:token), - start_index: options.delete(:start), - timeout_ms: options.delete(:timeout) + service.get_job_query_results \ + @project, job_id, + location: options.delete(:location), + max_results: options.delete(:max), + page_token: options.delete(:token), + start_index: options.delete(:start), + timeout_ms: options.delete(:timeout) end end def copy_table copy_job_gapi execute backoff: true do @@ -369,11 +369,11 @@ ## # Lists all projects to which you have been granted any project role. def list_projects options = {} execute backoff: true do service.list_projects max_results: options[:max], - page_token: options[:token] + page_token: options[:token] end end # If no job_id or prefix is given, always generate a client-side job ID # anyway, for idempotent retry in the google-api-client layer. @@ -381,10 +381,10 @@ def job_ref_from job_id, prefix, location: nil prefix ||= "job_" job_id ||= "#{prefix}#{generate_id}" job_ref = API::JobReference.new( project_id: @project, - job_id: job_id + job_id: job_id ) # BigQuery does not allow nil location, but missing is ok. job_ref.location = location if location job_ref end