Delete a dataset (beta)

Deletes a dataset for the given Google Cloud project.

Code sample

Python

To learn how to install and use the client library for Data Labeling Service, see Data Labeling Service client libraries. For more information, see the Data Labeling Service Python API reference documentation.

To authenticate to Data Labeling Service, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

def delete_dataset(dataset_resource_name):
    """Deletes a dataset for the given Google Cloud project."""
    from google.cloud import datalabeling_v1beta1 as datalabeling

    client = datalabeling.DataLabelingServiceClient()

    response = client.delete_dataset(request={"name": dataset_resource_name})

    print(f"Dataset deleted. {response}\n")

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.