Skip to content

Commit

Permalink
feat: Add the RANGE type to the google.cloud.bigquery.storage.v1.Tabl…
Browse files Browse the repository at this point in the history
…eFieldSchema (#746)

* feat: Add the RANGE type to the google.cloud.bigquery.storage.v1.TableFieldSchema

PiperOrigin-RevId: 607833489

Source-Link: googleapis/googleapis@87fc56b

Source-Link: googleapis/googleapis-gen@077b863
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDc3Yjg2M2ZmMzBmZjY1Zjk1ODQ3MTIyNmNjMzJhNjYyOGZlNzk1NSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Lingqing Gan <lingqing.gan@gmail.com>
  • Loading branch information
3 people authored Feb 20, 2024
1 parent 8f1d64f commit 47f6b05
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions google/cloud/bigquery_storage_v1/types/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ class TableFieldSchema(proto.Message):
Optional. A SQL expression to specify the [default value]
(https://cloud.google.com/bigquery/docs/default-values) for
this field.
range_element_type (google.cloud.bigquery_storage_v1.types.TableFieldSchema.FieldElementType):
Optional. The subtype of the RANGE, if the type of this
field is RANGE. If the type is RANGE, this field is
required. Possible values for the field element type of a
RANGE include:
- DATE
- DATETIME
- TIMESTAMP
"""

class Type(proto.Enum):
Expand Down Expand Up @@ -165,6 +174,8 @@ class Type(proto.Enum):
Interval
JSON (15):
JSON, String
RANGE (16):
RANGE
"""
TYPE_UNSPECIFIED = 0
STRING = 1
Expand All @@ -182,6 +193,7 @@ class Type(proto.Enum):
BIGNUMERIC = 13
INTERVAL = 14
JSON = 15
RANGE = 16

class Mode(proto.Enum):
r"""
Expand All @@ -201,6 +213,20 @@ class Mode(proto.Enum):
REQUIRED = 2
REPEATED = 3

class FieldElementType(proto.Message):
r"""Represents the type of a field element.
Attributes:
type_ (google.cloud.bigquery_storage_v1.types.TableFieldSchema.Type):
Required. The type of a field element.
"""

type_: "TableFieldSchema.Type" = proto.Field(
proto.ENUM,
number=1,
enum="TableFieldSchema.Type",
)

name: str = proto.Field(
proto.STRING,
number=1,
Expand Down Expand Up @@ -240,6 +266,11 @@ class Mode(proto.Enum):
proto.STRING,
number=10,
)
range_element_type: FieldElementType = proto.Field(
proto.MESSAGE,
number=11,
message=FieldElementType,
)


__all__ = tuple(sorted(__protobuf__.manifest))

0 comments on commit 47f6b05

Please sign in to comment.