# Module table (3.42.1)

3.42.1 (latest) 3.42.0 3.41.0 3.40.1 3.39.0 3.38.0 3.37.0 3.36.0 3.35.1 3.34.0 3.33.0 3.31.0 3.30.0 3.29.0 3.27.0 3.26.0 3.25.0 3.24.0 3.23.1 3.22.0 3.21.0 3.20.1 3.19.0 3.18.0 3.17.2 3.16.0 3.15.0 3.14.1 3.13.0 3.12.0 3.11.4 3.4.0 3.3.6 3.2.0 3.1.0 3.0.1 2.34.4 2.33.0 2.32.0 2.31.0 2.30.1 2.29.0 2.28.1 2.27.1 2.26.0 2.25.2 2.24.1 2.23.3 2.22.1 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.1 2.15.0 2.14.0 2.13.1 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.2 2.5.0 2.4.0 2.3.1 2.2.0 2.1.0 2.0.0 1.28.2 1.27.2 1.26.1 1.25.0 1.24.0 1.23.1 1.22.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 Define API Tables.

## Classes

### [BigLakeConfiguration](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.BigLakeConfiguration)

    BigLakeConfiguration(
        connection_id: typing.Optional[str] = None,
        storage_uri: typing.Optional[str] = None,
        file_format: typing.Optional[str] = None,
        table_format: typing.Optional[str] = None,
        _properties: typing.Optional[dict] = None,
    )

Configuration for managed tables for Apache Iceberg, formerly
known as BigLake.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `connection_id` | `Optional[str]` The connection specifying the credentials to be used to read and write to external storage, such as Cloud Storage. The connection_id can have the form `{project}.{location}.{connection_id}` or `projects/{project}/locations/{location}/connections/{connection_id}`. |
| `storage_uri` | `Optional[str]` The fully qualified location prefix of the external folder where table data is stored. The '\*' wildcard character is not allowed. The URI should be in the format `gs://bucket/path_to_table/`. |
| `file_format` | `Optional[str]` The file format the table data is stored in. See BigLakeFileFormat for available values. |
| `table_format` | `Optional[str]` The table format the metadata only snapshots are stored in. See BigLakeTableFormat for available values. |
| `_properties` | `Optional[dict]` Private. Used to construct object from API resource. |

### [CloneDefinition](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.CloneDefinition)

    CloneDefinition(resource: typing.Dict[str, typing.Any])

Information about base table and clone time of the clone.

See <https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#clonedefinition>

### [ColumnReference](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.ColumnReference)

    ColumnReference(referencing_column: str, referenced_column: str)

The pair of the foreign key column and primary key column.

### [ForeignKey](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.ForeignKey)

    ForeignKey(
        name: str,
        referenced_table: google.cloud.bigquery.table.TableReference,
        column_references: typing.List[google.cloud.bigquery.table.ColumnReference],
    )

Represents a foreign key constraint on a table's columns.

### [PartitionRange](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.PartitionRange)

    PartitionRange(start=None, end=None, interval=None, _properties=None)

Definition of the ranges for range partitioning.

> [!NOTE]
> **Note:** **Beta**. The integer range partitioning feature is in a pre-release state and might change or have limited support.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `start` | `Optional[int]` Sets the [start](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.PartitionRange) property. |
| `end` | `Optional[int]` Sets the [end](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.PartitionRange) property. |
| `interval` | `Optional[int]` Sets the [interval](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.PartitionRange) property. |
| `_properties` | `Optional[dict]` Private. Used to construct object from API resource. |

### [PrimaryKey](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.PrimaryKey)

    PrimaryKey(columns: typing.List[str])

Represents the primary key constraint on a table's columns.

### [PropertyGraphReference](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.PropertyGraphReference)

    PropertyGraphReference(dataset_ref: DatasetReference, property_graph_id: str)

PropertyGraphReferences are pointers to property graphs.

### [RangePartitioning](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.RangePartitioning)

    RangePartitioning(range_=None, field=None, _properties=None)

Range-based partitioning configuration for a table.

> [!NOTE]
> **Note:** **Beta**. The integer range partitioning feature is in a pre-release state and might change or have limited support.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `range_` | `Optional[https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.PartitionRange]` Sets the range_ property. |
| `field` | `Optional[str]` Sets the [field](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.RangePartitioning) property. |
| `_properties` | `Optional[dict]` Private. Used to construct object from API resource. |

### [Row](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.Row)

    Row(values, field_to_index)

A BigQuery row.

Values can be accessed by position (index), by key like a dict,
or as properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `values` | `Sequence[object]` The row values |
| `field_to_index` | `Dict[str, int]` A mapping from schema field names to indexes |

### [RowIterator](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.RowIterator)

    RowIterator(
        client,
        api_request,
        path,
        schema,
        page_token=None,
        max_results=None,
        page_size=None,
        extra_params=None,
        table=None,
        selected_fields=None,
        total_rows=None,
        first_page_response=None,
        location: typing.Optional[str] = None,
        job_id: typing.Optional[str] = None,
        query_id: typing.Optional[str] = None,
        project: typing.Optional[str] = None,
        num_dml_affected_rows: typing.Optional[int] = None,
        query: typing.Optional[str] = None,
        total_bytes_processed: typing.Optional[int] = None,
        slot_millis: typing.Optional[int] = None,
        created: typing.Optional[datetime.datetime] = None,
        started: typing.Optional[datetime.datetime] = None,
        ended: typing.Optional[datetime.datetime] = None,
    )

A class for iterating through HTTP/JSON API row list responses.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `Optional[str]` The query text used. |
| `total_bytes_processed` | `Optional[int]` If representing query results, the total bytes processed by the associated query. |
| `slot_millis` | `Optional[int]` If representing query results, the number of slot ms billed for the associated query. |
| `created` | `Optional[datetime.datetime]` If representing query results, the creation time of the associated query. |
| `started` | `Optional[datetime.datetime]` If representing query results, the start time of the associated query. |
| `ended` | `Optional[datetime.datetime]` If representing query results, the end time of the associated query. |
| `client` | `Optional[google.cloud.bigquery.Client]` The API client instance. This should always be non-`None`, except for subclasses that do not use it, namely the `_EmptyRowIterator`. |
| `api_request` | `Callable[google.cloud._http.JSONConnection.api_request]` The function to use to make API requests. |
| `path` | `str` The method path to query for the list of items. |
| `schema` | `Sequence[Union[ https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.schema.SchemaField, Mapping[str, Any] ]]` The table's schema. If any item is a mapping, its content must be compatible with [from_api_repr](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.schema.SchemaField). |
| `page_token` | `str` A token identifying a page in a result set to start fetching results from. |
| `max_results` | `Optional[int]` The maximum number of results to fetch. |
| `page_size` | `Optional[int]` The maximum number of rows in each page of results from this request. Non-positive values are ignored. Defaults to a sensible value set by the API. |
| `extra_params` | `Optional[Dict[str, object]]` Extra query string parameters for the API call. |
| `table` | `Optional[Union[ https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.Table, https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TableReference, ]]` The table which these rows belong to, or a reference to it. Used to call the BigQuery Storage API to fetch rows. |
| `selected_fields` | `Optional[Sequence[https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.schema.SchemaField]]` A subset of columns to select from this table. |
| `total_rows` | `Optional[int]` Total number of rows in the table. |
| `first_page_response` | `Optional[dict]` API response for the first page of results. These are returned when the first page is requested. |

### [SnapshotDefinition](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.SnapshotDefinition)

    SnapshotDefinition(resource: typing.Dict[str, typing.Any])

Information about base table and snapshot time of the snapshot.

See <https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#snapshotdefinition>

### [StreamingBuffer](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.StreamingBuffer)

    StreamingBuffer(resource)

Information about a table's streaming buffer.

See <https://cloud.google.com/bigquery/streaming-data-into-bigquery>.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resource` | `Dict[str, object]` streaming buffer representation returned from the API |

### [Table](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.Table)

    Table(table_ref, schema=None)

Tables represent a set of rows whose values correspond to a schema.

See
<https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#resource-table>

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `table_ref` | `Union[https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TableReference, str]` A pointer to a table. If `table_ref` is a string, it must included a project ID, dataset ID, and table ID, each separated by `.`. |
| `schema` | `Optional[Sequence[Union[ https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.schema.SchemaField, Mapping[str, Any] ]]]` The table's schema. If any item is a mapping, its content must be compatible with [from_api_repr](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.schema.SchemaField). |

### [TableConstraints](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TableConstraints)

    TableConstraints(
        primary_key: typing.Optional[google.cloud.bigquery.table.PrimaryKey],
        foreign_keys: typing.Optional[typing.List[google.cloud.bigquery.table.ForeignKey]],
    )

The TableConstraints defines the primary key and foreign key.

### [TableListItem](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.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** ||
|---|---|
| **Name** | **Description** |
| `resource` | `Dict[str, object]` A table-like resource object from a table list response. A `tableReference` property is required. |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `ValueError` | If `tableReference` or one of its required members is missing from `resource`. |

### [TableReference](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TableReference)

    TableReference(dataset_ref: DatasetReference, table_id: str)

TableReferences are pointers to tables.

See
<https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#tablereference>

### [TimePartitioning](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioning)

    TimePartitioning(
        type_=None, field=None, expiration_ms=None, require_partition_filter=None
    )

Configures time-based partitioning for a table.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `type_` | `Optional[https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioningType]` Specifies the type of time partitioning to perform. Defaults to [DAY](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioningType). Supported values are: \* [HOUR](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioningType) \* [DAY](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioningType) \* [MONTH](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioningType) \* [YEAR](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioningType) |
| `field` | `Optional[str]` If set, the table is partitioned by this field. If not set, the table is partitioned by pseudo column `PARTITIONTIME`. The field must be a top-level `TIMESTAMP`, `DATETIME`, or `DATE` field. Its mode must be `NULLABLE` or `REQUIRED`. See the `time-unit column-partitioned tables guide https://cloud.google.com/bigquery/docs/creating-column-partitions` in the BigQuery documentation. |
| `expiration_ms` | `Optional[int]` Number of milliseconds for which to keep the storage for a partition. |
| `require_partition_filter` | `Optional[bool]` DEPRECATED: Use [require_partition_filter](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.Table), instead. |

### [TimePartitioningType](https://docs.cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.table.TimePartitioningType)

    TimePartitioningType()

Specifies the type of time partitioning to perform.