Get a dataset (beta)

Get a dataset from a given Google Cloud project.

Code sample


Before trying this sample, follow the Python setup instructions in the Data Labeling Service Quickstart Using Client Libraries. For more information, see the Data Labeling Service Python API reference documentation.

def get_dataset(dataset_resource_name):
    """Gets a dataset for the given Google Cloud project."""
    from import datalabeling_v1beta1 as datalabeling

    client = datalabeling.DataLabelingServiceClient()

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

    print("The dataset resource name: {}\n".format(
    print("Display name: {}".format(response.display_name))
    print("Description: {}".format(response.description))
    print("Create time:")
    print("\tseconds: {}".format(response.create_time.timestamp_pb().seconds))
    print("\tnanos: {}".format(response.create_time.timestamp_pb().nanos))

What's next

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