Skip to content

Commit b8b5433

Browse files
feat: add standard sql table type, update scalar type enums (#777)
* feat: add standard sql table type, update scalar type enums Committer: @shollyman PiperOrigin-RevId: 385164907 Source-Link: googleapis/googleapis@9ae82b8 Source-Link: googleapis/googleapis-gen@bc1724b * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md * fix: exclude copying microgenerated '.coveragrc' * fix: add 'INTERVAL'/'JSON' to _SQL_SCALAR_TYPES Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Tres Seaver <[email protected]>
1 parent 22fd848 commit b8b5433

File tree

5 files changed

+25
-1
lines changed

5 files changed

+25
-1
lines changed

google/cloud/bigquery/enums.py

+2
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,11 @@ class KeyResultStatementKind:
191191
"DATE",
192192
"TIME",
193193
"DATETIME",
194+
"INTERVAL",
194195
"GEOGRAPHY",
195196
"NUMERIC",
196197
"BIGNUMERIC",
198+
"JSON",
197199
)
198200
)
199201

google/cloud/bigquery_v2/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from .types.standard_sql import StandardSqlDataType
2727
from .types.standard_sql import StandardSqlField
2828
from .types.standard_sql import StandardSqlStructType
29+
from .types.standard_sql import StandardSqlTableType
2930
from .types.table_reference import TableReference
3031

3132
__all__ = (
@@ -40,5 +41,6 @@
4041
"StandardSqlDataType",
4142
"StandardSqlField",
4243
"StandardSqlStructType",
44+
"StandardSqlTableType",
4345
"TableReference",
4446
)

google/cloud/bigquery_v2/types/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
StandardSqlDataType,
2828
StandardSqlField,
2929
StandardSqlStructType,
30+
StandardSqlTableType,
3031
)
3132
from .table_reference import TableReference
3233

@@ -42,5 +43,6 @@
4243
"StandardSqlDataType",
4344
"StandardSqlField",
4445
"StandardSqlStructType",
46+
"StandardSqlTableType",
4547
"TableReference",
4648
)

google/cloud/bigquery_v2/types/standard_sql.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818

1919
__protobuf__ = proto.module(
2020
package="google.cloud.bigquery.v2",
21-
manifest={"StandardSqlDataType", "StandardSqlField", "StandardSqlStructType",},
21+
manifest={
22+
"StandardSqlDataType",
23+
"StandardSqlField",
24+
"StandardSqlStructType",
25+
"StandardSqlTableType",
26+
},
2227
)
2328

2429

@@ -54,9 +59,11 @@ class TypeKind(proto.Enum):
5459
DATE = 10
5560
TIME = 20
5661
DATETIME = 21
62+
INTERVAL = 26
5763
GEOGRAPHY = 22
5864
NUMERIC = 23
5965
BIGNUMERIC = 24
66+
JSON = 25
6067
ARRAY = 16
6168
STRUCT = 17
6269

@@ -97,4 +104,14 @@ class StandardSqlStructType(proto.Message):
97104
fields = proto.RepeatedField(proto.MESSAGE, number=1, message="StandardSqlField",)
98105

99106

107+
class StandardSqlTableType(proto.Message):
108+
r"""A table type
109+
Attributes:
110+
columns (Sequence[google.cloud.bigquery_v2.types.StandardSqlField]):
111+
The columns in this table type
112+
"""
113+
114+
columns = proto.RepeatedField(proto.MESSAGE, number=1, message="StandardSqlField",)
115+
116+
100117
__all__ = tuple(sorted(__protobuf__.manifest))

owlbot.py

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
library,
7171
excludes=[
7272
"*.tar.gz",
73+
".coveragerc",
7374
"docs/index.rst",
7475
f"docs/bigquery_{library.name}/*_service.rst",
7576
f"docs/bigquery_{library.name}/services.rst",

0 commit comments

Comments
 (0)