Skip to content

Commit

Permalink
refactor: delete location config that is unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
joker1007 committed Nov 22, 2024
1 parent f458399 commit 6ebbd6a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Because embedded gem dependency sometimes restricts ruby environment.
| private_key_path | string | yes (private_key) | no | nil | GCP Private Key file path |
| private_key_passphrase | string | yes (private_key) | no | nil | GCP Private Key Passphrase |
| json_key | string | yes (json_key) | no | nil | GCP JSON Key file path or JSON Key string |
| location | string | no | no | nil | BigQuery Data Location. The geographic location of the job. Required except for US and EU. |
| project | string | yes | yes | nil | |
| dataset | string | yes | yes | nil | |
| table | string | yes (either `tables`) | yes | nil | |
Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin/bigquery/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def create_load_job(chunk_id, chunk_id_hex, project, dataset, table_id, upload_s
def fetch_load_job(job_reference)
project = job_reference.project_id
job_id = job_reference.job_id
location = @options[:location]
location = job_reference.location

res = client.get_job(project, job_id, location: location)
log.debug "load job fetched", id: job_id, state: res.status.state, **job_reference.as_hash(:project_id, :dataset_id, :table_id)
Expand Down
4 changes: 0 additions & 4 deletions lib/fluent/plugin/out_bigquery_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ class BigQueryBaseOutput < Output
config_param :private_key_path, :string, default: nil
config_param :private_key_passphrase, :string, default: 'notasecret', secret: true
config_param :json_key, default: nil, secret: true
# The geographic location of the job. Required except for US and EU.
# https://github.com/googleapis/google-api-ruby-client/blob/master/generated/google/apis/bigquery_v2/service.rb#L350
config_param :location, :string, default: nil

# see as simple reference
# https://github.com/abronte/BigQuery/blob/master/lib/bigquery.rb
Expand Down Expand Up @@ -135,7 +132,6 @@ def writer
private_key_path: @private_key_path, private_key_passphrase: @private_key_passphrase,
email: @email,
json_key: @json_key,
location: @location,
source_format: @source_format,
skip_invalid_rows: @skip_invalid_rows,
ignore_unknown_values: @ignore_unknown_values,
Expand Down

0 comments on commit 6ebbd6a

Please sign in to comment.