kura 0.2.6 → 0.2.7

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: bc987e74d2254841e0ac7628fb45da2e6b0ab396
4
- data.tar.gz: 64b831382a82bd0d71b7e611c3ac5e01e147889a
3
+ metadata.gz: 39922e26110ff492d11e7e1bf9fa774cfeb5139e
4
+ data.tar.gz: 9cbab5d9463b9df6b5cb4c1ac0f0cd535bb906dd
5
5
  SHA512:
6
- metadata.gz: 761a30c77db3e7f62aaa291be33f455d2c2428b7a5f1ba45e726efae6d4162ba958c44d9e6a740c82b8348a9ea805dbe34b19c64f19ea0ac5d1f2530a387bad5
7
- data.tar.gz: ffe4e6ce67195278d38bbd2862d599810aec646a85ac7ca53430ffc01ec6218eb6699b481b0d6b20067ac7fa07f53c2466d9a849b22e283cd479b8917dfb3f5b
6
+ metadata.gz: 2921b4b127d0bb7e2eb9b209793f1851311a3a1a049aa0c10096532430c967d34dcd1e9c13e23f82a7952a89a57ef004239bcf1c26f337f5009b37556523c5f5
7
+ data.tar.gz: 8cc2d5a7e16194bab35a445072845e067b5ac0466dd1d8fd40ca64477274e4ebe9dcb11f095638db9d2061ed61afd23ba72c33d85ed6d53327acecdfabcd4b58
data/ChangeLog.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.2.7
2
+
3
+ ## Fixes
4
+
5
+ * Fix job API parameter processing. The boolean parameter in nested hash could be ignored when
6
+ `false` was passed on googla-api-client-0.9.pre3.
7
+ The keyword arguments `flatten_results` of `query` and `print_header` of `extract` were ignored.
8
+
1
9
  # 0.2.6
2
10
 
3
11
  ## Fixes
data/lib/kura/client.rb CHANGED
@@ -271,26 +271,26 @@ module Kura
271
271
  wait: nil,
272
272
  &blk)
273
273
  write_disposition = mode_to_write_disposition(mode)
274
- configuration = {
275
- query: {
274
+ configuration = Google::Apis::BigqueryV2::JobConfiguration.new({
275
+ query: Google::Apis::BigqueryV2::JobConfigurationQuery.new({
276
276
  query: sql,
277
277
  write_disposition: write_disposition,
278
278
  allow_large_results: allow_large_results,
279
279
  flatten_results: flatten_results,
280
280
  priority: priority,
281
281
  use_query_cache: use_query_cache,
282
- }
283
- }
282
+ })
283
+ })
284
284
  if dataset_id and table_id
285
- configuration[:query][:destination_table] = { project_id: project_id, dataset_id: dataset_id, table_id: table_id }
285
+ configuration.query.destination_table = Google::Apis::BigqueryV2::TableReference.new({ project_id: project_id, dataset_id: dataset_id, table_id: table_id })
286
286
  end
287
287
  if user_defined_function_resources
288
- configuration[:query][:user_defined_function_resources] = Array(user_defined_function_resources).map do |r|
288
+ configuration.query.user_defined_function_resources = Array(user_defined_function_resources).map do |r|
289
289
  r = r.to_s
290
290
  if r.start_with?("gs://")
291
- { resource_uri: r }
291
+ Google::Apis::BigqueryV2::UserDefinedFunctionResource.new({ resource_uri: r })
292
292
  else
293
- { inline_code: r }
293
+ Google::Apis::BigqueryV2::UserDefinedFunctionResource.new({ inline_code: r })
294
294
  end
295
295
  end
296
296
  end
@@ -336,31 +336,31 @@ module Kura
336
336
  &blk)
337
337
  write_disposition = mode_to_write_disposition(mode)
338
338
  source_uris = [source_uris] if source_uris.is_a?(String)
339
- configuration = {
340
- load: {
341
- destination_table: {
339
+ configuration = Google::Apis::BigqueryV2::JobConfiguration.new({
340
+ load: Google::Apis::BigqueryV2::JobConfigurationLoad.new({
341
+ destination_table: Google::Apis::BigqueryV2::TableReference.new({
342
342
  project_id: project_id,
343
343
  dataset_id: dataset_id,
344
344
  table_id: table_id,
345
- },
345
+ }),
346
346
  write_disposition: write_disposition,
347
347
  allow_jagged_rows: allow_jagged_rows,
348
348
  max_bad_records: max_bad_records,
349
349
  ignore_unknown_values: ignore_unknown_values,
350
350
  source_format: source_format,
351
- }
352
- }
351
+ })
352
+ })
353
353
  if schema
354
- configuration[:load][:schema] = { fields: normalize_schema(schema) }
354
+ configuration.load.schema = Google::Apis::BigqueryV2::TableSchema.new({ fields: normalize_schema(schema) })
355
355
  end
356
356
  if source_format == "CSV"
357
- configuration[:load][:field_delimiter] = field_delimiter
358
- configuration[:load][:allow_quoted_newlines] = allow_quoted_newlines
359
- configuration[:load][:quote] = quote
360
- configuration[:load][:skip_leading_rows] = skip_leading_rows
357
+ configuration.load.field_delimiter = field_delimiter
358
+ configuration.load.allow_quoted_newlines = allow_quoted_newlines
359
+ configuration.load.quote = quote
360
+ configuration.load.skip_leading_rows = skip_leading_rows
361
361
  end
362
362
  unless file
363
- configuration[:load][:source_uris] = source_uris
363
+ configuration.load.source_uris = source_uris
364
364
  end
365
365
  insert_job(configuration, media: file, wait: wait, project_id: job_project_id, &blk)
366
366
  end
@@ -375,21 +375,21 @@ module Kura
375
375
  wait: nil,
376
376
  &blk)
377
377
  dest_uris = [ dest_uris ] if dest_uris.is_a?(String)
378
- configuration = {
379
- extract: {
378
+ configuration = Google::Apis::BigqueryV2::JobConfiguration.new({
379
+ extract: Google::Apis::BigqueryV2::JobConfigurationExtract.new({
380
380
  compression: compression,
381
381
  destination_format: destination_format,
382
- source_table: {
382
+ source_table: Google::Apis::BigqueryV2::TableReference.new({
383
383
  project_id: project_id,
384
384
  dataset_id: dataset_id,
385
385
  table_id: table_id,
386
- },
386
+ }),
387
387
  destination_uris: dest_uris,
388
- }
389
- }
388
+ })
389
+ })
390
390
  if destination_format == "CSV"
391
- configuration[:extract][:field_delimiter] = field_delimiter
392
- configuration[:extract][:print_header] = print_header
391
+ configuration.extract.field_delimiter = field_delimiter
392
+ configuration.extract.print_header = print_header
393
393
  end
394
394
  insert_job(configuration, wait: wait, project_id: job_project_id, &blk)
395
395
  end
@@ -402,21 +402,21 @@ module Kura
402
402
  wait: nil,
403
403
  &blk)
404
404
  write_disposition = mode_to_write_disposition(mode)
405
- configuration = {
406
- copy: {
407
- destination_table: {
405
+ configuration = Google::Apis::BigqueryV2::JobConfiguration.new({
406
+ copy: Google::Apis::BigqueryV2::JobConfigurationCopy.new({
407
+ destination_table: Google::Apis::BigqueryV2::TableReference.new({
408
408
  project_id: dest_project_id,
409
409
  dataset_id: dest_dataset_id,
410
410
  table_id: dest_table_id,
411
- },
412
- source_table: {
411
+ }),
412
+ source_table: Google::Apis::BigqueryV2::TableReference.new({
413
413
  project_id: src_project_id,
414
414
  dataset_id: src_dataset_id,
415
415
  table_id: src_table_id,
416
- },
416
+ }),
417
417
  write_disposition: write_disposition,
418
- }
419
- }
418
+ })
419
+ })
420
420
  insert_job(configuration, wait: wait, project_id: job_project_id, &blk)
421
421
  end
422
422
 
data/lib/kura/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kura
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
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.6
4
+ version: 0.2.7
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-11-24 00:00:00.000000000 Z
11
+ date: 2015-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client