embulk-output-bigquery 0.7.0 → 0.7.1

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
  SHA256:
3
- metadata.gz: 36a45d63bf6d79411d67ef26d736e3a55035220b92923f208c8e08c7af5aeeae
4
- data.tar.gz: 3be9cdc0cfd8c05cc7d6f427ba6aa9a4091220c8eb5b4cef8786cde8d86a86bd
3
+ metadata.gz: 4fba97c5f4a2935df80c4c4efb7f389c9818f221773c856b5f490f8e3e65c172
4
+ data.tar.gz: e6949d104a822c586dc65180aff030af3da963a535a9e2ca3a9ac5b93f706527
5
5
  SHA512:
6
- metadata.gz: a112e890334fa11d95ebfa40719654f7c6a78ea3fcda19edc141060f68516b748353ca76c2f1e35d1b2ea6ba9aec852f6279f91d0d57879387786465e8651d03
7
- data.tar.gz: 776ad5a340e420874b5ff9daa2860797fe9a656ce2f8fc3585ab4aff8d671f2725628803cacccfe54c10a68acefe956f73aa3b717a243aebd1566bf68ab7068f
6
+ metadata.gz: 695c2c596d172eed178ddf34e12b985c7179cff73924d316641e77e4ee52465bb79d94d7e7c1141a7831859fe44d15cfd28b6f7aa0b409ce0d57626ac83abea9
7
+ data.tar.gz: c48f7b6ce8df9141f2c716ffec0d0786fc5aa87cad034fffeb6df5055236cb5dff651f41f17580a6041b769cfd9198be36656909b87e1c844a694faef42616fa
@@ -13,9 +13,9 @@ jobs:
13
13
  - 9.4.2.0
14
14
  fail-fast: false
15
15
  steps:
16
- - uses: actions/checkout@v3
16
+ - uses: actions/checkout@v4
17
17
  - name: Set up OpenJDK 8
18
- uses: actions/setup-java@v3
18
+ uses: actions/setup-java@v4
19
19
  with:
20
20
  java-version: 8
21
21
  distribution: "temurin"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.7.1 - 2024-03-4
2
+ * [enhancement] Support description of columns and tables (Thanks to @kyoshidajp and @fagai ) #142
3
+ * [maintenance] Add missing GitHub Actions environment setting. #160
4
+ * [maintenance] Replace google-api-client with specific Google APIs (Thanks to @Nozomuts) #161
5
+ * [maintenance] Update GitHub Actions use checkout@v4 and setup-java@v4 #162
6
+
1
7
  ## 0.7.0 - 2024-02-1
2
8
  * [enhancement] Add support Embulk 0.11.x
3
9
 
data/README.md CHANGED
@@ -60,6 +60,7 @@ OAuth flow for installed applications.
60
60
  | gcs_bucket | string | optional | nil | See [GCS Bucket](#gcs-bucket) |
61
61
  | auto_create_gcs_bucket | boolean | optional | false | See [GCS Bucket](#gcs-bucket) |
62
62
  | progress_log_interval | float | optional | nil (Disabled) | Progress log interval. The progress log is disabled by nil (default). NOTE: This option may be removed in a future because a filter plugin can achieve the same goal |
63
+ | description | string | optional | nil | description of table |
63
64
 
64
65
  Client or request options
65
66
 
@@ -329,6 +330,7 @@ Column options are used to aid guessing BigQuery schema, or to define conversion
329
330
  - json: `STRING`, `RECORD` (default: `STRING`)
330
331
  - **mode**: BigQuery mode such as `NULLABLE`, `REQUIRED`, and `REPEATED` (string, default: `NULLABLE`)
331
332
  - **fields**: Describes the nested schema fields if the type property is set to RECORD. Please note that this is **required** for `RECORD` column.
333
+ - **description**: description (string, default is `None`).
332
334
  - **timestamp_format**: timestamp format to convert into/from `timestamp` (string, default is `default_timestamp_format`)
333
335
  - **timezone**: timezone to convert into/from `timestamp`, `date` (string, default is `default_timezone`).
334
336
  - **default_timestamp_format**: default timestamp format for column_options (string, default is "%Y-%m-%d %H:%M:%S.%6N")
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "embulk-output-bigquery"
3
- spec.version = "0.7.0"
3
+ spec.version = "0.7.1"
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."
@@ -15,7 +15,8 @@ Gem::Specification.new do |spec|
15
15
  spec.require_paths = ["lib"]
16
16
 
17
17
  # the latest version
18
- spec.add_dependency 'google-api-client','= 0.53.0'
18
+ spec.add_dependency 'google-apis-storage_v1'
19
+ spec.add_dependency 'google-apis-bigquery_v2'
19
20
  spec.add_dependency 'time_with_zone'
20
21
  spec.add_dependency 'thwait'
21
22
  # activesupport require Ruby >= 2.7.0
@@ -420,6 +420,7 @@ module Embulk
420
420
  table_reference: {
421
421
  table_id: table,
422
422
  },
423
+ description: @task['description'],
423
424
  schema: {
424
425
  fields: fields,
425
426
  }
@@ -46,10 +46,11 @@ module Embulk
46
46
  embulk_type = column[:type]
47
47
  column_option = column_options_map[column_name] || {}
48
48
  {}.tap do |field|
49
- field[:name] = column_name
50
- field[:type] = (column_option['type'] || bq_type_from_embulk_type(embulk_type)).upcase
51
- field[:mode] = column_option['mode'] if column_option['mode']
52
- field[:fields] = deep_symbolize_keys(column_option['fields']) if column_option['fields']
49
+ field[:name] = column_name
50
+ field[:type] = (column_option['type'] || bq_type_from_embulk_type(embulk_type)).upcase
51
+ field[:mode] = column_option['mode'] if column_option['mode']
52
+ field[:fields] = deep_symbolize_keys(column_option['fields']) if column_option['fields']
53
+ field[:description] = column_option['description'] if column_option['description']
53
54
  end
54
55
  end
55
56
  end
@@ -63,6 +63,8 @@ module Embulk
63
63
  'payload_column' => config.param('payload_column', :string, :default => nil),
64
64
  'payload_column_index' => config.param('payload_column_index', :integer, :default => nil),
65
65
 
66
+ 'description' => config.param('description', :string, :default => nil),
67
+
66
68
  'open_timeout_sec' => config.param('open_timeout_sec', :integer, :default => nil),
67
69
  'timeout_sec' => config.param('timeout_sec', :integer, :default => nil), # google-api-ruby-client < v0.11.0
68
70
  'send_timeout_sec' => config.param('send_timeout_sec', :integer, :default => nil), # google-api-ruby-client >= v0.11.0
data/test/test_helper.rb CHANGED
@@ -68,7 +68,7 @@ module Embulk
68
68
  ])
69
69
  task = {
70
70
  'column_options' => [
71
- {'name' => 'boolean', 'type' => 'STRING', 'mode' => 'REQUIRED'},
71
+ {'name' => 'boolean', 'type' => 'STRING', 'mode' => 'REQUIRED', 'description' => 'hoge'},
72
72
  {'name' => 'long', 'type' => 'STRING'},
73
73
  {'name' => 'double', 'type' => 'STRING'},
74
74
  {'name' => 'string', 'type' => 'INTEGER'},
@@ -81,7 +81,7 @@ module Embulk
81
81
  ],
82
82
  }
83
83
  expected = [
84
- {name: 'boolean', type: 'STRING', mode: 'REQUIRED'},
84
+ {name: 'boolean', type: 'STRING', mode: 'REQUIRED', description: 'hoge'},
85
85
  {name: 'long', type: 'STRING'},
86
86
  {name: 'double', type: 'STRING'},
87
87
  {name: 'string', type: 'INTEGER'},
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.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Akama
@@ -9,22 +9,36 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-02-13 00:00:00.000000000 Z
12
+ date: 2024-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: google-api-client
15
+ name: google-apis-storage_v1
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 0.53.0
20
+ version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '='
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: google-apis-bigquery_v2
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
26
33
  - !ruby/object:Gem::Version
27
- version: 0.53.0
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: time_with_zone
30
44
  requirement: !ruby/object:Gem::Requirement