Define API Datasets.
Classes
AccessEntry
AccessEntry(
role: typing.Optional[str] = None,
entity_type: typing.Optional[str] = None,
entity_id: typing.Optional[typing.Union[typing.Dict[str, typing.Any], str]] = None,
)Represents grant of an access role to an entity.
An entry must have exactly one of the allowed
xref_EntityTypes. If anything but view, routine,
or dataset are set, a role is also required. role is omitted for view,
routine, dataset, because they are always read-only.
See https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets.
| Parameters | |
|---|---|
| Name | Description |
role |
typing.Optional[str]
Role granted to the entity. The following string values are supported: |
entity_type |
typing.Optional[str]
Type of entity being granted the role. See EntityTypes for supported types. |
entity_id |
typing.Union[typing.Dict[str, typing.Any], str, NoneType]
If the |
| Exceptions | |
|---|---|
| Type | Description |
ValueError |
If a view, routine, or dataset has role set, or a non view, non routine, and non dataset **does not** have a role set. .. rubric:: Examples >>> entry = AccessEntry('OWNER', 'userByEmail', 'user@example.com') >>> view = { ... 'projectId': 'my-project', ... 'datasetId': 'my_dataset', ... 'tableId': 'my_table' ... } >>> entry = AccessEntry(None, 'view', view) |
Dataset
Dataset(dataset_ref)Datasets are containers for tables.
See https://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 |
DatasetListItem
DatasetListItem(resource)A read-only dataset resource from a list operation.
For performance reasons, the BigQuery API only includes some of the dataset properties when listing datasets. Notably, xref_access_entries is missing.
For a full list of the properties that the BigQuery API returns, see the
REST documentation for datasets.list
<https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets/list>_.
| Parameter | |
|---|---|
| Name | Description |
resource |
Dict[str, str]
A dataset-like resource object from a dataset list response. A |
| Exceptions | |
|---|---|
| Type | Description |
ValueError |
If datasetReference or one of its required members is missing from resource. |
DatasetReference
DatasetReference(project: str, dataset_id: str)DatasetReferences are pointers to datasets.
See https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference
| Parameters | |
|---|---|
| Name | Description |
project |
str
The ID of the project |
dataset_id |
str
The ID of the dataset |
| Exceptions | |
|---|---|
| Type | Description |
ValueError |
If either argument is not of type str. |