Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add standard sql table type, update scalar type enums #777

Merged
merged 4 commits into from Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Expand Up @@ -2,7 +2,6 @@
branch = True

[report]
fail_under = 100
tseaver marked this conversation as resolved.
Show resolved Hide resolved
show_missing = True
omit =
google/cloud/bigquery/__init__.py
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/bigquery_v2/__init__.py
Expand Up @@ -26,6 +26,7 @@
from .types.standard_sql import StandardSqlDataType
from .types.standard_sql import StandardSqlField
from .types.standard_sql import StandardSqlStructType
from .types.standard_sql import StandardSqlTableType
from .types.table_reference import TableReference

__all__ = (
Expand All @@ -40,5 +41,6 @@
"StandardSqlDataType",
"StandardSqlField",
"StandardSqlStructType",
"StandardSqlTableType",
"TableReference",
)
2 changes: 2 additions & 0 deletions google/cloud/bigquery_v2/types/__init__.py
Expand Up @@ -27,6 +27,7 @@
StandardSqlDataType,
StandardSqlField,
StandardSqlStructType,
StandardSqlTableType,
)
from .table_reference import TableReference

Expand All @@ -42,5 +43,6 @@
"StandardSqlDataType",
"StandardSqlField",
"StandardSqlStructType",
"StandardSqlTableType",
"TableReference",
)
19 changes: 18 additions & 1 deletion google/cloud/bigquery_v2/types/standard_sql.py
Expand Up @@ -18,7 +18,12 @@

__protobuf__ = proto.module(
package="google.cloud.bigquery.v2",
manifest={"StandardSqlDataType", "StandardSqlField", "StandardSqlStructType",},
manifest={
"StandardSqlDataType",
"StandardSqlField",
"StandardSqlStructType",
"StandardSqlTableType",
},
)


Expand Down Expand Up @@ -54,9 +59,11 @@ class TypeKind(proto.Enum):
DATE = 10
TIME = 20
DATETIME = 21
INTERVAL = 26
GEOGRAPHY = 22
NUMERIC = 23
BIGNUMERIC = 24
JSON = 25
ARRAY = 16
STRUCT = 17

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


class StandardSqlTableType(proto.Message):
r"""A table type
Attributes:
columns (Sequence[google.cloud.bigquery_v2.types.StandardSqlField]):
The columns in this table type
"""

columns = proto.RepeatedField(proto.MESSAGE, number=1, message="StandardSqlField",)


__all__ = tuple(sorted(__protobuf__.manifest))