diff --git a/lib/embulk/output/bigquery/gcs_client.rb b/lib/embulk/output/bigquery/gcs_client.rb index 0e0b57f..c2bf162 100644 --- a/lib/embulk/output/bigquery/gcs_client.rb +++ b/lib/embulk/output/bigquery/gcs_client.rb @@ -48,7 +48,7 @@ def insert_temporary_bucket(bucket = nil) opts = {} Embulk.logger.debug { "embulk-output-bigquery: insert_temporary_bucket(#{@project}, #{body}, #{opts})" } - with_network_retry { client.insert_bucket(@project, body, opts) } + with_network_retry { client.insert_bucket(@project, body, **opts) } rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e if e.status_code == 409 && /conflict:/ =~ e.message # ignore 'Already Exists' error @@ -81,7 +81,7 @@ def insert_object(path, object: nil, bucket: nil) Embulk.logger.debug { "embulk-output-bigquery: insert_object(#{bucket}, #{body}, #{opts})" } # memo: gcs is strongly consistent for insert (read-after-write). ref: https://cloud.google.com/storage/docs/consistency - with_network_retry { client.insert_object(bucket, body, opts) } + with_network_retry { client.insert_object(bucket, body, **opts) } rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e response = {status_code: e.status_code, message: e.message, error_class: e.class} Embulk.logger.error { @@ -114,7 +114,7 @@ def delete_object(object, bucket: nil) opts = {} Embulk.logger.debug { "embulk-output-bigquery: delete_object(#{bucket}, #{object}, #{opts})" } - response = with_network_retry { client.delete_object(bucket, object, opts) } + response = with_network_retry { client.delete_object(bucket, object, **opts) } rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e if e.status_code == 404 # ignore 'notFound' error return nil