Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK Examples. GitHub
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Utilizzare con un SDK DeleteDataset
AWS
Il seguente esempio di codice mostra come utilizzareDeleteDataset
.
Per ulteriori informazioni, vedere Eliminazione di un set di dati.
- Python
-
- SDK per Python (Boto3)
-
class Datasets:
@staticmethod
def delete_dataset(lookoutvision_client, project_name, dataset_type):
"""
Deletes a Lookout for Vision dataset
:param lookoutvision_client: A Boto3 Lookout for Vision client.
:param project_name: The name of the project that contains the dataset that
you want to delete.
:param dataset_type: The type (train or test) of the dataset that you
want to delete.
"""
try:
logger.info(
"Deleting the %s dataset for project %s.", dataset_type, project_name
)
lookoutvision_client.delete_dataset(
ProjectName=project_name, DatasetType=dataset_type
)
logger.info("Dataset deleted.")
except ClientError:
logger.exception("Service error: Couldn't delete dataset.")
raise