Skip to main content

datasets

Creates, updates, deletes, gets or lists a datasets resource.

Overview

Namedatasets
TypeResource
Idgoogle.datalabeling.datasets

Fields

NameDatatypeDescription
namestringOutput only. Dataset resource name, format is: projects/{project_id}/datasets/{dataset_id}
descriptionstringOptional. User-provided description of the annotation specification set. The description can be up to 10000 characters long.
blockingResourcesarrayOutput only. The names of any related resources that are blocking changes to the dataset.
createTimestringOutput only. Time the dataset is created.
dataItemCountstringOutput only. The number of data items in the dataset.
displayNamestringRequired. The display name of the dataset. Maximum of 64 characters.
inputConfigsarrayOutput only. This is populated with the original input configs where ImportData is called. It is available only after the clients import data to this dataset.
lastMigrateTimestringLast time that the Dataset is migrated to AI Platform V2. If any of the AnnotatedDataset is migrated, the last_migration_time in Dataset is also updated.

Methods

NameAccessible byRequired ParamsDescription
projects_datasets_getSELECTdatasetsId, projectsIdGets dataset by resource name.
projects_datasets_listSELECTprojectsIdLists datasets under a project. Pagination is supported.
projects_datasets_createINSERTprojectsIdCreates dataset. If success return a Dataset resource.
projects_datasets_deleteDELETEdatasetsId, projectsIdDeletes a dataset by resource name.
projects_datasets_export_dataEXECdatasetsId, projectsIdExports data and annotations from dataset.
projects_datasets_import_dataEXECdatasetsId, projectsIdImports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.

SELECT examples

Lists datasets under a project. Pagination is supported.

SELECT
name,
description,
blockingResources,
createTime,
dataItemCount,
displayName,
inputConfigs,
lastMigrateTime
FROM google.datalabeling.datasets
WHERE projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new datasets resource.

/*+ create */
INSERT INTO google.datalabeling.datasets (
projectsId,
dataset
)
SELECT
'{{ projectsId }}',
'{{ dataset }}'
;

DELETE example

Deletes the specified datasets resource.

/*+ delete */
DELETE FROM google.datalabeling.datasets
WHERE datasetsId = '{{ datasetsId }}'
AND projectsId = '{{ projectsId }}';