Skip to content

Commit 2eca01d

Browse files
committed
Use double splat
JRuby 9.4.x compatible MRI 3.1. MRI 3.0 introduced "REAL" keyward argument. https://bugs.ruby-lang.org/issues/14183 This codes raise Argument Error. def foo(a, b, c, key: 1) end h = {key: 42} foo(1, 2, 3, h) It is necessary to change like the following. def foo(a, b, c, key: 1) end h = {key: 42} foo(1, 2, 3, **h)
1 parent 7d82eb1 commit 2eca01d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/embulk/output/bigquery/bigquery_client.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def load_from_gcs(object_uris, table)
121121
opts = {}
122122

123123
Embulk.logger.debug { "embulk-output-bigquery: insert_job(#{@project}, #{body}, #{opts})" }
124-
response = with_network_retry { client.insert_job(@project, body, opts) }
124+
response = with_network_retry { client.insert_job(@project, body, **opts) }
125125
unless @task['is_skip_job_result_check']
126126
response = wait_load('Load', response)
127127
end
@@ -222,7 +222,7 @@ def load(path, table, write_disposition: 'WRITE_APPEND')
222222
# },
223223
}
224224
Embulk.logger.debug { "embulk-output-bigquery: insert_job(#{@project}, #{body}, #{opts})" }
225-
response = with_network_retry { client.insert_job(@project, body, opts) }
225+
response = with_network_retry { client.insert_job(@project, body, **opts) }
226226
if @task['is_skip_job_result_check']
227227
response
228228
else
@@ -278,7 +278,7 @@ def copy(source_table, destination_table, destination_dataset = nil, write_dispo
278278

279279
opts = {}
280280
Embulk.logger.debug { "embulk-output-bigquery: insert_job(#{@project}, #{body}, #{opts})" }
281-
response = with_network_retry { client.insert_job(@project, body, opts) }
281+
response = with_network_retry { client.insert_job(@project, body, **opts) }
282282
wait_load('Copy', response)
283283
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
284284
response = {status_code: e.status_code, message: e.message, error_class: e.class}
@@ -372,7 +372,7 @@ def create_dataset(dataset = nil, reference: nil)
372372
end
373373
opts = {}
374374
Embulk.logger.debug { "embulk-output-bigquery: insert_dataset(#{@project}, #{dataset}, #{@location_for_log}, #{body}, #{opts})" }
375-
with_network_retry { client.insert_dataset(@project, body, opts) }
375+
with_network_retry { client.insert_dataset(@project, body, **opts) }
376376
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
377377
if e.status_code == 409 && /Already Exists:/ =~ e.message
378378
# ignore 'Already Exists' error
@@ -447,7 +447,7 @@ def create_table_if_not_exists(table, dataset: nil, options: nil)
447447

448448
opts = {}
449449
Embulk.logger.debug { "embulk-output-bigquery: insert_table(#{@project}, #{dataset}, #{@location_for_log}, #{body}, #{opts})" }
450-
with_network_retry { client.insert_table(@project, dataset, body, opts) }
450+
with_network_retry { client.insert_table(@project, dataset, body, **opts) }
451451
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
452452
if e.status_code == 409 && /Already Exists:/ =~ e.message
453453
# ignore 'Already Exists' error

0 commit comments

Comments
 (0)