google.cloud.bigquery.dataset.Dataset#
Methods
|
Factory: construct a dataset given its API representation |
|
Construct a dataset from fully-qualified dataset ID. |
|
Constructs a ModelReference. |
|
Constructs a RoutineReference. |
|
Constructs a TableReference. |
Construct the API resource representation of this dataset |
Attributes
Dataset’s access entries. |
|
Datetime at which the dataset was created ( |
|
Dataset ID. |
|
Default expiration time for tables in the dataset (defaults to |
|
Description of the dataset as set by the user (defaults to |
|
ETag for the dataset resource ( |
|
Title of the dataset as set by the user (defaults to |
|
ID for the dataset resource ( |
|
Labels for the dataset. |
|
Location in which the dataset is hosted as set by the user (defaults to |
|
Datetime at which the dataset was last modified ( |
|
URL path for the dataset based on project and dataset ID. |
|
Project ID of the project bound to the dataset. |
|
A reference to this dataset. |
|
URL for the dataset resource ( |
-
class
google.cloud.bigquery.dataset.
Dataset
(dataset_ref)[source]# Bases:
object
Datasets are containers for tables.
See https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets
- Parameters
dataset_ref (Union[
DatasetReference
, str, ]) – A pointer to a dataset. Ifdataset_ref
is a string, it must include both the project ID and the dataset ID, separated by.
.
-
property
access_entries
# Dataset’s access entries.
role
augments the entity type and must be present unless the entity type isview
.- Raises
TypeError – If ‘value’ is not a sequence
ValueError – If any item in the sequence is not an
AccessEntry
.
- Type
-
property
created
# Datetime at which the dataset was created (
None
until set from the server).- Type
Union[datetime.datetime, None]
-
property
default_table_expiration_ms
# Default expiration time for tables in the dataset (defaults to
None
).- Raises
ValueError – For invalid value types.
- Type
-
property
description
# Description of the dataset as set by the user (defaults to
None
).- Raises
ValueError – for invalid value types.
- Type
-
property
friendly_name
# Title of the dataset as set by the user (defaults to
None
).- Raises
ValueError – for invalid value types.
- Type
-
classmethod
from_api_repr
(resource)[source]# Factory: construct a dataset given its API representation
- Parameters
(Dict[str (resource) – object]): Dataset resource representation returned from the API
- Returns
Dataset parsed from
resource
.- Return type
-
classmethod
from_string
(full_dataset_id)[source]# Construct a dataset from fully-qualified dataset ID.
- Parameters
full_dataset_id (str) – A fully-qualified dataset ID in standard SQL format. Must include both the project ID and the dataset ID, separated by
.
.- Returns
Dataset parsed from
full_dataset_id
.- Return type
Examples
>>> Dataset.from_string('my-project-id.some_dataset') Dataset(DatasetReference('my-project-id', 'some_dataset'))
- Raises
ValueError – If
full_dataset_id
is not a fully-qualified dataset ID in standard SQL format.
-
property
full_dataset_id
# ID for the dataset resource (
None
until set from the server)In the format
project_id:dataset_id
.
-
property
labels
# Labels for the dataset.
This method always returns a dict. To change a dataset’s labels, modify the dict, then call
google.cloud.bigquery.client.Client.update_dataset()
. To delete a label, set its value toNone
before updating.- Raises
ValueError – for invalid value types.
- Type
-
property
location
# Location in which the dataset is hosted as set by the user (defaults to
None
).- Raises
ValueError – for invalid value types.
- Type
-
model
(model_id)# Constructs a ModelReference.
- Parameters
model_id (str) – the ID of the model.
- Returns
A ModelReference for a model in this dataset.
- Return type
-
property
modified
# Datetime at which the dataset was last modified (
None
until set from the server).- Type
Union[datetime.datetime, None]
-
property
reference
# A reference to this dataset.
-
routine
(routine_id)# Constructs a RoutineReference.
- Parameters
routine_id (str) – the ID of the routine.
- Returns
A RoutineReference for a routine in this dataset.
- Return type