Class SchemaField (1.17.0)

SchemaField(name, field_type, mode="NULLABLE", description=None, fields=())

Describe a single field within a table schema.

Parameters

NameDescription
name str

the name of the field.

field_type str

the type of the field. See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#schema.fields.type

mode str

the mode of the field. See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#schema.fields.mode

description Optional[str]

description for the field.

fields Tuple[SchemaField]

subfields (requires field_type of 'RECORD').

Inheritance

builtins.object > SchemaField

Properties

description

Optional[str]: description for the field.

field_type

fields

tuple: Subfields contained in this field.

Must be empty unset if field_type is not 'RECORD'.

is_nullable

bool: whether 'mode' is 'nullable'.

mode

name

str: The name of the field.

Methods

__init__

__init__(name, field_type, mode="NULLABLE", description=None, fields=())

Initialize self. See help(type(self)) for accurate signature.

from_api_repr

from_api_repr(api_repr)

Return a SchemaField object deserialized from a dictionary.

Parameter
NameDescription
api_repr Mapping[str, str]

The serialized representation of the SchemaField, such as what is output by to_api_repr.

Returns
TypeDescription
google.cloud.biquery.schema.SchemaFieldThe ``SchemaField`` object.

to_api_repr

to_api_repr()

Return a dictionary representing this schema field.

Returns
TypeDescription
dictA dictionary representing the SchemaField in a serialized form.

SchemaField

SchemaField(name, field_type, mode="NULLABLE", description=None, fields=())

Describe a single field within a table schema.

Parameters
NameDescription
name str

the name of the field.

field_type str

the type of the field. See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#schema.fields.type

mode str

the mode of the field. See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#schema.fields.mode

description Optional[str]

description for the field.

fields Tuple[SchemaField]

subfields (requires field_type of 'RECORD').