google-cloud-bigquery 1.32.0 → 1.35.0

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.
@@ -601,7 +601,7 @@ module Google
601
601
 
602
602
  protected
603
603
 
604
- def retry? result, current_retries #:nodoc:
604
+ def retry? result, current_retries
605
605
  if current_retries < @retries && retry_error_reason?(result)
606
606
  return true
607
607
  end
@@ -2369,12 +2369,15 @@ module Google
2369
2369
  # | `BIGNUMERIC` | `String` | Pass as `String` to avoid rounding to scale 9. |
2370
2370
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
2371
2371
  # | `DATE` | `Date` | |
2372
+ # | `GEOGRAPHY` | `String` | Well-known text (WKT) or GeoJSON. |
2372
2373
  # | `TIMESTAMP` | `Time` | |
2373
2374
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
2374
2375
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
2375
2376
  # | `ARRAY` | `Array` | Nested arrays, `nil` values are not supported. |
2376
2377
  # | `STRUCT` | `Hash` | Hash keys may be strings or symbols. |
2377
2378
  #
2379
+ # For `GEOGRAPHY` data, see [Working with BigQuery GIS data](https://cloud.google.com/bigquery/docs/gis-data).
2380
+ #
2378
2381
  # Because BigQuery's streaming API is designed for high insertion rates,
2379
2382
  # modifications to the underlying table metadata are eventually
2380
2383
  # consistent when interacting with the streaming system. In most cases
@@ -3238,6 +3241,12 @@ module Google
3238
3241
  # @param [Symbol] mode The field's mode. The possible values are
3239
3242
  # `:nullable`, `:required`, and `:repeated`. The default value is
3240
3243
  # `:nullable`.
3244
+ # @param [Array<String>, String] policy_tags The policy tag list or
3245
+ # single policy tag for the field. Policy tag identifiers are of
3246
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3247
+ # At most 1 policy tag is currently allowed.
3248
+ # @param [Integer] max_length The maximum UTF-8 length of strings
3249
+ # allowed in the field.
3241
3250
  #
3242
3251
  # @example
3243
3252
  # require "google/cloud/bigquery"
@@ -3249,8 +3258,8 @@ module Google
3249
3258
  # end
3250
3259
  #
3251
3260
  # @!group Schema
3252
- def string name, description: nil, mode: :nullable
3253
- schema.string name, description: description, mode: mode
3261
+ def string name, description: nil, mode: :nullable, policy_tags: nil, max_length: nil
3262
+ schema.string name, description: description, mode: mode, policy_tags: policy_tags, max_length: max_length
3254
3263
  end
3255
3264
 
3256
3265
  ##
@@ -3266,6 +3275,10 @@ module Google
3266
3275
  # @param [Symbol] mode The field's mode. The possible values are
3267
3276
  # `:nullable`, `:required`, and `:repeated`. The default value is
3268
3277
  # `:nullable`.
3278
+ # @param [Array<String>, String] policy_tags The policy tag list or
3279
+ # single policy tag for the field. Policy tag identifiers are of
3280
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3281
+ # At most 1 policy tag is currently allowed.
3269
3282
  #
3270
3283
  # @example
3271
3284
  # require "google/cloud/bigquery"
@@ -3277,8 +3290,8 @@ module Google
3277
3290
  # end
3278
3291
  #
3279
3292
  # @!group Schema
3280
- def integer name, description: nil, mode: :nullable
3281
- schema.integer name, description: description, mode: mode
3293
+ def integer name, description: nil, mode: :nullable, policy_tags: nil
3294
+ schema.integer name, description: description, mode: mode, policy_tags: policy_tags
3282
3295
  end
3283
3296
 
3284
3297
  ##
@@ -3294,6 +3307,10 @@ module Google
3294
3307
  # @param [Symbol] mode The field's mode. The possible values are
3295
3308
  # `:nullable`, `:required`, and `:repeated`. The default value is
3296
3309
  # `:nullable`.
3310
+ # @param [Array<String>, String] policy_tags The policy tag list or
3311
+ # single policy tag for the field. Policy tag identifiers are of
3312
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3313
+ # At most 1 policy tag is currently allowed.
3297
3314
  #
3298
3315
  # @example
3299
3316
  # require "google/cloud/bigquery"
@@ -3305,8 +3322,8 @@ module Google
3305
3322
  # end
3306
3323
  #
3307
3324
  # @!group Schema
3308
- def float name, description: nil, mode: :nullable
3309
- schema.float name, description: description, mode: mode
3325
+ def float name, description: nil, mode: :nullable, policy_tags: nil
3326
+ schema.float name, description: description, mode: mode, policy_tags: policy_tags
3310
3327
  end
3311
3328
 
3312
3329
  ##
@@ -3333,6 +3350,20 @@ module Google
3333
3350
  # @param [Symbol] mode The field's mode. The possible values are
3334
3351
  # `:nullable`, `:required`, and `:repeated`. The default value is
3335
3352
  # `:nullable`.
3353
+ # @param [Array<String>, String] policy_tags The policy tag list or
3354
+ # single policy tag for the field. Policy tag identifiers are of
3355
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3356
+ # At most 1 policy tag is currently allowed.
3357
+ # @param [Integer] precision The precision (maximum number of total
3358
+ # digits) for the field. Acceptable values for precision must be:
3359
+ # `1 ≤ (precision - scale) ≤ 29`. Values for scale must be:
3360
+ # `0 ≤ scale ≤ 9`. If the scale value is set, the precision value
3361
+ # must be set as well.
3362
+ # @param [Integer] scale The scale (maximum number of digits in the
3363
+ # fractional part) for the field. Acceptable values for precision
3364
+ # must be: `1 ≤ (precision - scale) ≤ 29`. Values for scale must
3365
+ # be: `0 ≤ scale ≤ 9`. If the scale value is set, the precision
3366
+ # value must be set as well.
3336
3367
  #
3337
3368
  # @example
3338
3369
  # require "google/cloud/bigquery"
@@ -3344,8 +3375,13 @@ module Google
3344
3375
  # end
3345
3376
  #
3346
3377
  # @!group Schema
3347
- def numeric name, description: nil, mode: :nullable
3348
- schema.numeric name, description: description, mode: mode
3378
+ def numeric name, description: nil, mode: :nullable, policy_tags: nil, precision: nil, scale: nil
3379
+ schema.numeric name,
3380
+ description: description,
3381
+ mode: mode,
3382
+ policy_tags: policy_tags,
3383
+ precision: precision,
3384
+ scale: scale
3349
3385
  end
3350
3386
 
3351
3387
  ##
@@ -3372,6 +3408,20 @@ module Google
3372
3408
  # @param [Symbol] mode The field's mode. The possible values are
3373
3409
  # `:nullable`, `:required`, and `:repeated`. The default value is
3374
3410
  # `:nullable`.
3411
+ # @param [Array<String>, String] policy_tags The policy tag list or
3412
+ # single policy tag for the field. Policy tag identifiers are of
3413
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3414
+ # At most 1 policy tag is currently allowed.
3415
+ # @param [Integer] precision The precision (maximum number of total
3416
+ # digits) for the field. Acceptable values for precision must be:
3417
+ # `1 ≤ (precision - scale) ≤ 38`. Values for scale must be:
3418
+ # `0 ≤ scale ≤ 38`. If the scale value is set, the precision value
3419
+ # must be set as well.
3420
+ # @param [Integer] scale The scale (maximum number of digits in the
3421
+ # fractional part) for the field. Acceptable values for precision
3422
+ # must be: `1 ≤ (precision - scale) ≤ 38`. Values for scale must
3423
+ # be: `0 ≤ scale ≤ 38`. If the scale value is set, the precision
3424
+ # value must be set as well.
3375
3425
  #
3376
3426
  # @example
3377
3427
  # require "google/cloud/bigquery"
@@ -3383,8 +3433,13 @@ module Google
3383
3433
  # end
3384
3434
  #
3385
3435
  # @!group Schema
3386
- def bignumeric name, description: nil, mode: :nullable
3387
- schema.bignumeric name, description: description, mode: mode
3436
+ def bignumeric name, description: nil, mode: :nullable, policy_tags: nil, precision: nil, scale: nil
3437
+ schema.bignumeric name,
3438
+ description: description,
3439
+ mode: mode,
3440
+ policy_tags: policy_tags,
3441
+ precision: precision,
3442
+ scale: scale
3388
3443
  end
3389
3444
 
3390
3445
  ##
@@ -3400,6 +3455,10 @@ module Google
3400
3455
  # @param [Symbol] mode The field's mode. The possible values are
3401
3456
  # `:nullable`, `:required`, and `:repeated`. The default value is
3402
3457
  # `:nullable`.
3458
+ # @param [Array<String>, String] policy_tags The policy tag list or
3459
+ # single policy tag for the field. Policy tag identifiers are of
3460
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3461
+ # At most 1 policy tag is currently allowed.
3403
3462
  #
3404
3463
  # @example
3405
3464
  # require "google/cloud/bigquery"
@@ -3411,8 +3470,8 @@ module Google
3411
3470
  # end
3412
3471
  #
3413
3472
  # @!group Schema
3414
- def boolean name, description: nil, mode: :nullable
3415
- schema.boolean name, description: description, mode: mode
3473
+ def boolean name, description: nil, mode: :nullable, policy_tags: nil
3474
+ schema.boolean name, description: description, mode: mode, policy_tags: policy_tags
3416
3475
  end
3417
3476
 
3418
3477
  ##
@@ -3428,6 +3487,12 @@ module Google
3428
3487
  # @param [Symbol] mode The field's mode. The possible values are
3429
3488
  # `:nullable`, `:required`, and `:repeated`. The default value is
3430
3489
  # `:nullable`.
3490
+ # @param [Array<String>, String] policy_tags The policy tag list or
3491
+ # single policy tag for the field. Policy tag identifiers are of
3492
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3493
+ # At most 1 policy tag is currently allowed.
3494
+ # @param [Integer] max_length The maximum the maximum number of
3495
+ # bytes in the field.
3431
3496
  #
3432
3497
  # @example
3433
3498
  # require "google/cloud/bigquery"
@@ -3439,8 +3504,8 @@ module Google
3439
3504
  # end
3440
3505
  #
3441
3506
  # @!group Schema
3442
- def bytes name, description: nil, mode: :nullable
3443
- schema.bytes name, description: description, mode: mode
3507
+ def bytes name, description: nil, mode: :nullable, policy_tags: nil, max_length: nil
3508
+ schema.bytes name, description: description, mode: mode, policy_tags: policy_tags, max_length: max_length
3444
3509
  end
3445
3510
 
3446
3511
  ##
@@ -3456,6 +3521,10 @@ module Google
3456
3521
  # @param [Symbol] mode The field's mode. The possible values are
3457
3522
  # `:nullable`, `:required`, and `:repeated`. The default value is
3458
3523
  # `:nullable`.
3524
+ # @param [Array<String>, String] policy_tags The policy tag list or
3525
+ # single policy tag for the field. Policy tag identifiers are of
3526
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3527
+ # At most 1 policy tag is currently allowed.
3459
3528
  #
3460
3529
  # @example
3461
3530
  # require "google/cloud/bigquery"
@@ -3467,8 +3536,8 @@ module Google
3467
3536
  # end
3468
3537
  #
3469
3538
  # @!group Schema
3470
- def timestamp name, description: nil, mode: :nullable
3471
- schema.timestamp name, description: description, mode: mode
3539
+ def timestamp name, description: nil, mode: :nullable, policy_tags: nil
3540
+ schema.timestamp name, description: description, mode: mode, policy_tags: policy_tags
3472
3541
  end
3473
3542
 
3474
3543
  ##
@@ -3484,6 +3553,10 @@ module Google
3484
3553
  # @param [Symbol] mode The field's mode. The possible values are
3485
3554
  # `:nullable`, `:required`, and `:repeated`. The default value is
3486
3555
  # `:nullable`.
3556
+ # @param [Array<String>, String] policy_tags The policy tag list or
3557
+ # single policy tag for the field. Policy tag identifiers are of
3558
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3559
+ # At most 1 policy tag is currently allowed.
3487
3560
  #
3488
3561
  # @example
3489
3562
  # require "google/cloud/bigquery"
@@ -3495,8 +3568,8 @@ module Google
3495
3568
  # end
3496
3569
  #
3497
3570
  # @!group Schema
3498
- def time name, description: nil, mode: :nullable
3499
- schema.time name, description: description, mode: mode
3571
+ def time name, description: nil, mode: :nullable, policy_tags: nil
3572
+ schema.time name, description: description, mode: mode, policy_tags: policy_tags
3500
3573
  end
3501
3574
 
3502
3575
  ##
@@ -3512,6 +3585,10 @@ module Google
3512
3585
  # @param [Symbol] mode The field's mode. The possible values are
3513
3586
  # `:nullable`, `:required`, and `:repeated`. The default value is
3514
3587
  # `:nullable`.
3588
+ # @param [Array<String>, String] policy_tags The policy tag list or
3589
+ # single policy tag for the field. Policy tag identifiers are of
3590
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3591
+ # At most 1 policy tag is currently allowed.
3515
3592
  #
3516
3593
  # @example
3517
3594
  # require "google/cloud/bigquery"
@@ -3523,8 +3600,8 @@ module Google
3523
3600
  # end
3524
3601
  #
3525
3602
  # @!group Schema
3526
- def datetime name, description: nil, mode: :nullable
3527
- schema.datetime name, description: description, mode: mode
3603
+ def datetime name, description: nil, mode: :nullable, policy_tags: nil
3604
+ schema.datetime name, description: description, mode: mode, policy_tags: policy_tags
3528
3605
  end
3529
3606
 
3530
3607
  ##
@@ -3540,6 +3617,10 @@ module Google
3540
3617
  # @param [Symbol] mode The field's mode. The possible values are
3541
3618
  # `:nullable`, `:required`, and `:repeated`. The default value is
3542
3619
  # `:nullable`.
3620
+ # @param [Array<String>, String] policy_tags The policy tag list or
3621
+ # single policy tag for the field. Policy tag identifiers are of
3622
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3623
+ # At most 1 policy tag is currently allowed.
3543
3624
  #
3544
3625
  # @example
3545
3626
  # require "google/cloud/bigquery"
@@ -3551,8 +3632,39 @@ module Google
3551
3632
  # end
3552
3633
  #
3553
3634
  # @!group Schema
3554
- def date name, description: nil, mode: :nullable
3555
- schema.date name, description: description, mode: mode
3635
+ def date name, description: nil, mode: :nullable, policy_tags: nil
3636
+ schema.date name, description: description, mode: mode, policy_tags: policy_tags
3637
+ end
3638
+
3639
+ ##
3640
+ # Adds a geography field to the schema.
3641
+ #
3642
+ # @see https://cloud.google.com/bigquery/docs/gis-data Working with BigQuery GIS data
3643
+ #
3644
+ # @param [String] name The field name. The name must contain only
3645
+ # letters (a-z, A-Z), numbers (0-9), or underscores (_), and must
3646
+ # start with a letter or underscore. The maximum length is 128
3647
+ # characters.
3648
+ # @param [String] description A description of the field.
3649
+ # @param [Symbol] mode The field's mode. The possible values are
3650
+ # `:nullable`, `:required`, and `:repeated`. The default value is
3651
+ # `:nullable`.
3652
+ # @param [Array<String>, String] policy_tags The policy tag list or
3653
+ # single policy tag for the field. Policy tag identifiers are of
3654
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
3655
+ # At most 1 policy tag is currently allowed.
3656
+ #
3657
+ # @example
3658
+ # require "google/cloud/bigquery"
3659
+ #
3660
+ # bigquery = Google::Cloud::Bigquery.new
3661
+ # dataset = bigquery.dataset "my_dataset"
3662
+ # table = dataset.create_table "my_table" do |schema|
3663
+ # schema.geography "home", mode: :required
3664
+ # end
3665
+ #
3666
+ def geography name, description: nil, mode: :nullable, policy_tags: nil
3667
+ schema.geography name, description: description, mode: mode, policy_tags: policy_tags
3556
3668
  end
3557
3669
 
3558
3670
  ##
@@ -110,6 +110,7 @@ module Google
110
110
  # | `BIGNUMERIC` | `String` | Pass as `String` to avoid rounding to scale 9. |
111
111
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
112
112
  # | `DATE` | `Date` | |
113
+ # | `GEOGRAPHY` | `String` | |
113
114
  # | `TIMESTAMP` | `Time` | |
114
115
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
115
116
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigquery
19
- VERSION = "1.32.0".freeze
19
+ VERSION = "1.35.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.32.0
4
+ version: 1.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-06-21 00:00:00.000000000 Z
12
+ date: 2021-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby
@@ -101,6 +101,20 @@ dependencies:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.1'
104
+ - !ruby/object:Gem::Dependency
105
+ name: google-cloud-data_catalog
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.2'
111
+ type: :development
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.2'
104
118
  - !ruby/object:Gem::Dependency
105
119
  name: google-style
106
120
  requirement: !ruby/object:Gem::Requirement