Class Dataset (2.4.0) Stay organized with collections Save and categorize content based on your preferences.
- 3.40.0 (latest)
- 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
Dataset(dataset_ref)Datasets are containers for tables.
Seehttps://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#resource-dataset
Parameter
| Name | Description |
| dataset_ref | Union[google.cloud.bigquery.dataset.DatasetReference, str]A pointer to a dataset. If |
Inheritance
builtins.object >DatasetProperties
access_entries
List[google.cloud.bigquery.dataset.AccessEntry]: Dataset's accessentries.
role augments the entity type and must be presentunless theentity type isview orroutine.
| Type | Description |
| TypeError | If 'value' is not a sequence |
| ValueError | If any item in the sequence is not anAccessEntry. |
created
Union[datetime.datetime, None]: Datetime at which the dataset wascreated (:data:None until set from the server).
dataset_id
str: Dataset ID.
default_encryption_configuration
google.cloud.bigquery.encryption_configuration.EncryptionConfiguration: Customencryption configuration for all tables in the dataset.
Custom encryption configuration (e.g., Cloud KMS keys) or :data:Noneif using default encryption.
Seeprotecting data with Cloud KMS keys<https://cloud.google.com/bigquery/docs/customer-managed-encryption>;_in the BigQuery documentation.
default_partition_expiration_ms
Optional[int]: The default partition expiration for allpartitioned tables in the dataset, in milliseconds.
Once this property is set, all newly-created partitioned tables inthe dataset will have antime_paritioning.expiration_ms propertyset to this value, and changing the value will only affect newtables, not existing ones. The storage in a partition will have anexpiration time of its partition time plus this value.
Setting this property overrides the use ofdefault_table_expiration_ms for partitioned tables: only one ofdefault_table_expiration_ms anddefault_partition_expiration_ms will be used for any newpartitioned table. If you provide an explicittime_partitioning.expiration_ms when creating or updating apartitioned table, that value takes precedence over the defaultpartition expiration time indicated by this property.
default_table_expiration_ms
Union[int, None]: Default expiration time for tables in the dataset(defaults to :data:None).
| Type | Description |
| ValueError | For invalid value types. |
description
Optional[str]: Description of the dataset as set by the user(defaults to :data:None).
| Type | Description |
| ValueError | for invalid value types. |
etag
Union[str, None]: ETag for the dataset resource (:data:None untilset from the server).
friendly_name
Union[str, None]: Title of the dataset as set by the user(defaults to :data:None).
| Type | Description |
| ValueError | for invalid value types. |
full_dataset_id
Union[str, None]: ID for the dataset resource (:data:None untilset from the server)
In the formatproject_id:dataset_id.
labels
Dict[str, str]: Labels for the dataset.
This method always returns a dict. To change a dataset's labels,modify the dict, then callxref_update_dataset. To deletea label, set its value to :data:None before updating.
| Type | Description |
| ValueError | for invalid value types. |
location
Union[str, None]: Location in which the dataset is hosted as set bythe user (defaults to :data:None).
| Type | Description |
| ValueError | for invalid value types. |
modified
Union[datetime.datetime, None]: Datetime at which the dataset waslast modified (:data:None until set from the server).
path
str: URL path for the dataset based on project and dataset ID.
project
str: Project ID of the project bound to the dataset.
reference
google.cloud.bigquery.dataset.DatasetReference: A reference to thisdataset.
self_link
Union[str, None]: URL for the dataset resource (:data:None untilset from the server).
Methods
from_api_repr
from_api_repr(resource)Factory: construct a dataset given its API representation
| Type | Description |
| google.cloud.bigquery.dataset.Dataset | Dataset parsed from ``resource``. |
from_string
from_string(full_dataset_id)Construct a dataset from fully-qualified dataset ID.
| Name | Description |
| full_dataset_id | strA fully-qualified dataset ID in standard SQL format. Must include both the project ID and the dataset ID, separated by |
| Type | Description |
| ValueError | If ``full_dataset_id`` is not a fully-qualified dataset ID in standard SQL format. |
| Type | Description |
| Dataset .. rubric:: Examples >>> Dataset.from_string('my-project-id.some_dataset') Dataset(DatasetReference('my-project-id', 'some_dataset')) | Dataset parsed from ``full_dataset_id``. |
model
model(model_id)Constructs a ModelReference.
| Name | Description |
| model_id | strthe ID of the model. |
| Type | Description |
| google.cloud.bigquery.model.ModelReference | A ModelReference for a model in this dataset. |
routine
routine(routine_id)Constructs a RoutineReference.
| Name | Description |
| routine_id | strthe ID of the routine. |
| Type | Description |
| google.cloud.bigquery.routine.RoutineReference | A RoutineReference for a routine in this dataset. |
table
table(table_id)Constructs a TableReference.
| Name | Description |
| table_id | strThe ID of the table. |
| Type | Description |
| google.cloud.bigquery.table.TableReference | A table reference for a table in this dataset. |
to_api_repr
to_api_repr()Construct the API resource representation of this dataset
| Type | Description |
| Dict[str, object] | The dataset represented as an API resource |
__init__
__init__(dataset_ref)Initialize self. See help(type(self)) for accurate signature.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-09 UTC.