kura 0.2.2 → 0.2.3

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: a43b8117003920b804b11dc4ea494d4055c78cff
4
- data.tar.gz: ec0b100e696809181e1d15623ba8d7a70e02a11e
3
+ metadata.gz: 72bfe38a1cb2d6eb9136e74c92b212abff576b4e
4
+ data.tar.gz: b618287bd89c84a42a3347e344ef5a2141d490cc
5
5
  SHA512:
6
- metadata.gz: 9b37896a3d33c84502fd998e8aab0e283dbd207f78fb6be72ffdca68c339e33d531b620effe26b727bbce260437a740ecb1a3511a7362749809148151e95f6f0
7
- data.tar.gz: fc63b4a36b3280448a38c99e09de3a49f3ba8cf2938fcf60ea889ef08d4bcbdf1f99e15c8b66c41bcfd675da53f2686f392e2ed865a4cc2b9060449d9e3c88e6
6
+ metadata.gz: 16a14158a42249195698e7bebb5f610239f41da8403518b141021fdfcf7a1d74deadd33833abe128e63ef3228d7ba414b455df131ce1cab804c77fe47a1bd208
7
+ data.tar.gz: ddb033f950bd98ba1ad369a80e406418415f0ff7ec68ba6837c08f90ce795e4de143f500ad340f9047b5eb284cacf0cfc99175d2d8841e1f86c63714cb8299ab
data/ChangeLog.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 0.2.3
2
+
3
+ ## Enhancements
4
+
5
+ * Support User Defined Function in Kura::Client#query.
6
+ https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query.userDefinedFunctionResources
7
+ Kura::Client#query accept `user_defined_function_resources` keyword arguments.
8
+ It should be a String or Array of strings.
9
+ The string begin with "gs://" is treated as URI for GCS object.
10
+
1
11
  # 0.2.2
2
12
 
3
13
  ## Enhancements
data/lib/kura/client.rb CHANGED
@@ -198,6 +198,7 @@ module Kura
198
198
  flatten_results: true,
199
199
  priority: "INTERACTIVE",
200
200
  use_query_cache: true,
201
+ user_defined_function_resources: nil,
201
202
  project_id: @default_project_id,
202
203
  job_project_id: @default_project_id,
203
204
  wait: nil,
@@ -216,6 +217,16 @@ module Kura
216
217
  if dataset_id and table_id
217
218
  configuration[:query][:destination_table] = { project_id: project_id, dataset_id: dataset_id, table_id: table_id }
218
219
  end
220
+ if user_defined_function_resources
221
+ configuration[:query][:user_defined_function_resources] = Array(user_defined_function_resources).map do |r|
222
+ r = r.to_s
223
+ if r.start_with?("gs://")
224
+ { resource_uri: r }
225
+ else
226
+ { inline_code: r }
227
+ end
228
+ end
229
+ end
219
230
  insert_job(configuration, wait: wait, project_id: job_project_id, &blk)
220
231
  end
221
232
 
data/lib/kura/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kura
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kura
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chikanaga Tomoyuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-08 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client