gfw.common.bigquery.Schema#
- class Schema(fields)[source]#
A BigQuery schema with conversion utilities.
Wraps a list of
SchemaFieldobjects and provides methods to convert to other formats.- Parameters:
fields (list[bigquery.SchemaField]) – List of BigQuery schema fields.
Methods
Return the schema as a list of BigQuery field descriptor dicts.
Convert to a
pyarrow.Schema.Construct a
Schemafrom a list of BigQuery field descriptor dicts.Load a BigQuery JSON schema file and return a
Schema.Attributes
The raw BigQuery
SchemaFieldlist.- classmethod from_dicts(dicts)[source]#
Construct a
Schemafrom a list of BigQuery field descriptor dicts.
- as_dicts()[source]#
Return the schema as a list of BigQuery field descriptor dicts.
Useful when passing a schema to interfaces that expect the JSON dict format (e.g.
WriteToBigQueryWrapper).