Skip to content

Commit c197ecf

Browse files
Merge pull request #164 from kashira202111/kashira/fix_bug_about_gcs_client
Fix `gcs_client` in order to load data using `gcs_bucket` parameter
2 parents b20fc4e + 2c1c9f6 commit c197ecf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/embulk/output/bigquery/gcs_client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def insert_temporary_bucket(bucket = nil)
4848
opts = {}
4949

5050
Embulk.logger.debug { "embulk-output-bigquery: insert_temporary_bucket(#{@project}, #{body}, #{opts})" }
51-
with_network_retry { client.insert_bucket(@project, body, opts) }
51+
with_network_retry { client.insert_bucket(@project, body, **opts) }
5252
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
5353
if e.status_code == 409 && /conflict:/ =~ e.message
5454
# ignore 'Already Exists' error
@@ -81,7 +81,7 @@ def insert_object(path, object: nil, bucket: nil)
8181

8282
Embulk.logger.debug { "embulk-output-bigquery: insert_object(#{bucket}, #{body}, #{opts})" }
8383
# memo: gcs is strongly consistent for insert (read-after-write). ref: https://cloud.google.com/storage/docs/consistency
84-
with_network_retry { client.insert_object(bucket, body, opts) }
84+
with_network_retry { client.insert_object(bucket, body, **opts) }
8585
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
8686
response = {status_code: e.status_code, message: e.message, error_class: e.class}
8787
Embulk.logger.error {
@@ -114,7 +114,7 @@ def delete_object(object, bucket: nil)
114114
opts = {}
115115

116116
Embulk.logger.debug { "embulk-output-bigquery: delete_object(#{bucket}, #{object}, #{opts})" }
117-
response = with_network_retry { client.delete_object(bucket, object, opts) }
117+
response = with_network_retry { client.delete_object(bucket, object, **opts) }
118118
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
119119
if e.status_code == 404 # ignore 'notFound' error
120120
return nil

0 commit comments

Comments
 (0)