lib/embulk/output/bigquery/bigquery_client.rb in embulk-output-bigquery-0.7.1 vs lib/embulk/output/bigquery/bigquery_client.rb in embulk-output-bigquery-0.7.2

- old
+ new

@@ -445,20 +445,20 @@ # expiration_time is expressed in milliseconds body[:expiration_time] = (Time.now.to_i + options['expiration_time']) * 1000 end opts = {} - Embulk.logger.debug { "embulk-output-bigquery: insert_table(#{@project}, #{dataset}, #{@location_for_log}, #{body}, #{opts})" } - with_network_retry { client.insert_table(@project, dataset, body, **opts) } + Embulk.logger.debug { "embulk-output-bigquery: insert_table(#{@destination_project}, #{dataset}, #{@location_for_log}, #{body}, #{opts})" } + with_network_retry { client.insert_table(@destination_project, dataset, body, **opts) } rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e if e.status_code == 409 && /Already Exists:/ =~ e.message # ignore 'Already Exists' error return end response = {status_code: e.status_code, message: e.message, error_class: e.class} Embulk.logger.error { - "embulk-output-bigquery: insert_table(#{@project}, #{dataset}, #{@location_for_log}, #{body}, #{opts}), response:#{response}" + "embulk-output-bigquery: insert_table(#{@destination_project}, #{dataset}, #{@location_for_log}, #{body}, #{opts}), response:#{response}" } raise Error, "failed to create table #{@destination_project}:#{dataset}.#{table} in #{@location_for_log}, response:#{response}" end end