Class TableListItem (2.26.0)

TableListItem(resource)

A read-only table resource from a list operation.

For performance reasons, the BigQuery API only includes some of the table properties when listing tables. Notably, xref_schema and xref_num_rows are missing.

For a full list of the properties that the BigQuery API returns, see the REST documentation for tables.list <https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/list>_.

Parameter

NameDescription
resource Dict[str, object]

A table-like resource object from a table list response. A tableReference property is required.

Inheritance

builtins.object > TableListItem

Properties

clustering_fields

Union[List[str], None]: Fields defining clustering for the table

(Defaults to :data:None).

Clustering fields are immutable after table creation.

created

Union[datetime.datetime, None]: Datetime at which the table was created (:data:None until set from the server).

dataset_id

str: ID of dataset containing the table.

expires

Union[datetime.datetime, None]: Datetime at which the table will be deleted.

friendly_name

Union[str, None]: Title of the table (defaults to :data:None).

full_table_id

Union[str, None]: ID for the table (:data:None until set from the server).

In the format project_id:dataset_id.table_id.

labels

Dict[str, str]: Labels for the table.

This method always returns a dict. To change a table's labels, modify the dict, then call Client.update_table. To delete a label, set its value to :data:None before updating.

partition_expiration

Union[int, None]: Expiration time in milliseconds for a partition.

If this property is set and type_ is not set, type_ will default to TimePartitioningType.DAY.

partitioning_type

Union[str, None]: Time partitioning of the table if it is partitioned (Defaults to :data:None).

project

str: Project bound to the table.

reference

A xref_TableReference pointing to this table.

Returns
TypeDescription
google.cloud.bigquery.table.TableReferencepointer to this table.

table_id

str: ID of the table.

table_type

Union[str, None]: The type of the table (:data:None until set from the server).

Possible values are 'TABLE', 'VIEW', or 'EXTERNAL'.

time_partitioning

google.cloud.bigquery.table.TimePartitioning: Configures time-based partitioning for a table.

view_use_legacy_sql

bool: Specifies whether to execute the view with Legacy or Standard SQL.

This boolean specifies whether to execute the view with Legacy SQL (:data:True) or Standard SQL (:data:False). The client side default is :data:False. The server-side default is :data:True. If this table is not a view, :data:None is returned.

Exceptions
TypeDescription
ValueErrorFor invalid value types.

Methods

from_string

from_string(full_table_id: str)

Construct a table from fully-qualified table ID.

Parameter
NameDescription
full_table_id str

A fully-qualified table ID in standard SQL format. Must included a project ID, dataset ID, and table ID, each separated by ..

Exceptions
TypeDescription
ValueErrorIf ``full_table_id`` is not a fully-qualified table ID in standard SQL format.
Returns
TypeDescription
Table .. rubric:: Examples >>> Table.from_string('my-project.mydataset.mytable') Table(TableRef...(D...('my-project', 'mydataset'), 'mytable'))Table parsed from ``full_table_id``.

to_api_repr

to_api_repr()

Constructs the API resource of this table

Returns
TypeDescription
Dict[str, object]Table represented as an API resource

to_bqstorage

to_bqstorage()

Construct a BigQuery Storage API representation of this table.

Returns
TypeDescription
strA reference to this table in the BigQuery Storage API.

__init__

__init__(resource)

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

TableListItem

TableListItem(resource)

A read-only table resource from a list operation.

For performance reasons, the BigQuery API only includes some of the table properties when listing tables. Notably, xref_schema and xref_num_rows are missing.

For a full list of the properties that the BigQuery API returns, see the REST documentation for tables.list <https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/list>_.

Parameter
NameDescription
resource Dict[str, object]

A table-like resource object from a table list response. A tableReference property is required.

Exceptions
TypeDescription
ValueErrorIf ``tableReference`` or one of its required members is missing from ``resource``.