Skip to content

Commit

Permalink
Add standard types to enum, rename enum
Browse files Browse the repository at this point in the history
  • Loading branch information
plamut committed Aug 19, 2019
1 parent ede93f5 commit bb000b9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bigquery/google/cloud/bigquery/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,23 @@ def _make_sql_scalars_enum():
StandardSqlDataTypes = _make_sql_scalars_enum()


# see also https://cloud.google.com/bigquery/data-types#legacy_sql_data_types
class LegacySqlDataTypes(str, enum.Enum):
"""Enum of legacy SQL types names."""
# See also: https://cloud.google.com/bigquery/data-types#legacy_sql_data_types
# and https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types
class SqlTypeNames(str, enum.Enum):
"""Enum of allowed SQL type names in schema.SchemaField."""

STRING = "STRING"
BYTES = "BYTES"
INTEGER = "INTEGER"
INT64 = "INTEGER"
FLOAT = "FLOAT"
FLOAT64 = "FLOAT"
NUMERIC = "NUMERIC"
BOOLEAN = "BOOLEAN"
BOOL = "BOOLEAN"
GEOGRAPHY = "GEOGRAPHY" # NOTE: not available in legacy types
RECORD = "RECORD"
STRUCT = "RECORD"
TIMESTAMP = "TIMESTAMP"
DATE = "DATE"
TIME = "TIME"
Expand Down

0 comments on commit bb000b9

Please sign in to comment.