google.cloud.bigquery.table.TableReference#
Methods
|
Factory: construct a table reference given its API representation |
|
Construct a table reference from table ID string. |
Construct the API resource representation of this table reference. |
|
Construct a BigQuery Storage API representation of this table. |
Attributes
ID of dataset containing the table. |
|
URL path for the table’s APIs. |
|
Project bound to the table |
|
The table ID. |
-
class
google.cloud.bigquery.table.
TableReference
(dataset_ref, table_id)[source]# Bases:
object
TableReferences are pointers to tables.
See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables
- Parameters
dataset_ref (google.cloud.bigquery.dataset.DatasetReference) – A pointer to the dataset
table_id (str) – The ID of the table
-
classmethod
from_api_repr
(resource)[source]# Factory: construct a table reference given its API representation
-
classmethod
from_string
(table_id, default_project=None)[source]# Construct a table reference from table ID string.
- Parameters
- Returns
Table reference parsed from
table_id
.- Return type
Examples
>>> TableReference.from_string('my-project.mydataset.mytable') TableRef...(DatasetRef...('my-project', 'mydataset'), 'mytable')
- Raises
ValueError – If
table_id
is not a fully-qualified table ID in standard SQL format.
-
to_bqstorage
()[source]# Construct a BigQuery Storage API representation of this table.
Install the
google-cloud-bigquery-storage
package to use this feature.If the
table_id
contains a partition identifier (e.g.my_table$201812
) or a snapshot identifier (e.g.mytable@1234567890
), it is ignored. Usegoogle.cloud.bigquery_storage_v1beta1.types.TableReadOptions
to filter rows by partition. Usegoogle.cloud.bigquery_storage_v1beta1.types.TableModifiers
to select a specific snapshot to read from.- Returns
A reference to this table in the BigQuery Storage API.
- Return type
google.cloud.bigquery_storage_v1beta1.types.TableReference
- Raises
ValueError – If the
google.cloud.bigquery_storage_v1beta1
module cannot be imported.