embulk-output-bigquery 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ff7af5986004058e6bfc02cca1f00e9809f61bc
4
- data.tar.gz: 243490b5b6468a9b204b9f7369eea55559fa08b0
3
+ metadata.gz: a24d41ba699a9ef9467658a3c9992a3c14c32495
4
+ data.tar.gz: 8ab8e872b21f05076cbc2b8c3e93e8bb64da3843
5
5
  SHA512:
6
- metadata.gz: 1ace47fce8c23201c9a9cfabfc8f35700c81495eecdf34e255fb463af89f053709a892b9ec0b1603f468d2a09d33b64773bc1ec0909de745efd020a4136504eb
7
- data.tar.gz: df1cbc7852e15de10bfd7d9fb88cb4c288926438a64beb7d7f88ebc077c7accf8c02e57778329249192f03b5b5da428eb2380074be4fcafc4d0cdcf640baed5b
6
+ metadata.gz: 046bca8f4fc0f913810bf783dc7747142985d0d7482d51fa158e9254de7087ffa8d5aebf3350f981b8c1fa2231bc6f72a5dcc8063d5cf57963344d4bf72fb4e9
7
+ data.tar.gz: 5c5f56560d4873379dd5979bb211cad8907635d75bbd409540ea1170f02503ab459fd1458cd3b6ef1ef4320cc57a6ff255440bb9e660656f9f304e2be2397a58
@@ -1,3 +1,6 @@
1
+ ## 0.4.8 - 2017-05-23
2
+ * [enhancement] Support location option for auto_create_gcs_bucket option (thanks to @potato2003)
3
+
1
4
  ## 0.4.7 - 2017-05-02
2
5
  * [enhancement] Support location option to allow to use 'asia-northeast1' region
3
6
 
data/README.md CHANGED
@@ -128,7 +128,7 @@ out:
128
128
 
129
129
  The geographic location of the dataset. Required except for US and EU.
130
130
 
131
- `auto_create_table` isn't supported except for US and EU. And GCS bucket should be in same region when you use `gcs_bucket`.
131
+ GCS bucket should be in same region when you use `gcs_bucket`.
132
132
 
133
133
  See also [Dataset Locations | BigQuery | Google Cloud](https://cloud.google.com/bigquery/docs/dataset-locations)
134
134
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "embulk-output-bigquery"
3
- spec.version = "0.4.7"
3
+ spec.version = "0.4.8"
4
4
  spec.authors = ["Satoshi Akama", "Naotoshi Seo"]
5
5
  spec.summary = "Google BigQuery output plugin for Embulk"
6
6
  spec.description = "Embulk plugin that insert records to Google BigQuery."
@@ -113,17 +113,6 @@ module Embulk
113
113
  task['table_old'] ||= task['table']
114
114
  end
115
115
 
116
- unless task['location'].nil?
117
- task['location'] = task['location'].downcase
118
- # google-api-client doesn't support create bucket with region
119
- # We need to use Cloud Storage Client Libraries to support it
120
- if task['auto_create_gcs_bucket']
121
- unless %w[us eu].include?(task['location'])
122
- raise ConfigError.new "`auto_create_gcs_bucket` isn't supported excepts in us/eu"
123
- end
124
- end
125
- end
126
-
127
116
  if task['table_old']
128
117
  task['table_old'] = now.strftime(task['table_old'])
129
118
  end
@@ -17,15 +17,21 @@ module Embulk
17
17
 
18
18
  @project = @task['project']
19
19
  @bucket = @task['gcs_bucket']
20
+ @location = @task['location']
20
21
  end
21
22
 
22
23
  def insert_bucket(bucket = nil)
23
24
  bucket ||= @bucket
24
25
  begin
25
26
  Embulk.logger.info { "embulk-output-bigquery: Insert bucket... #{@project}:#{bucket}" }
26
- body = {
27
- name: bucket,
27
+ body = {
28
+ name: bucket
28
29
  }
30
+
31
+ if @location
32
+ body[:location] = @location
33
+ end
34
+
29
35
  opts = {}
30
36
 
31
37
  Embulk.logger.debug { "embulk-output-bigquery: insert_bucket(#{@project}, #{body}, #{opts})" }
@@ -113,9 +113,6 @@ module Embulk
113
113
 
114
114
  config = least_config.merge('location' => 'asia-northeast1')
115
115
  assert_nothing_raised { Bigquery.configure(config, schema, processor_count) }
116
-
117
- config = least_config.merge('location' => 'asia-northeast1', 'auto_create_gcs_bucket' => true)
118
- assert_raise { Bigquery.configure(config, schema, processor_count) }
119
116
  end
120
117
 
121
118
  def test_dataset_table_old
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Akama
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-02 00:00:00.000000000 Z
12
+ date: 2018-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement