aip_sdk.delete_dataset
aip_sdk.delete_dataset(dataset_id: str, *, client: APIClient | None = None) -> None
Permanently delete a dataset, all of its versions, and their stored files.
Irreversible and unprompted. To retire a dataset while keeping it readable,
use patch_dataset_status(dataset_id, "deprecated") instead.
Returning successfully means the dataset and its versions are gone. Purging the stored files is best-effort and completes after the deletion itself, so an object store outage can leave files behind for the platform to clean up.
Requires the workspace_admin or workspace_editor role.
Parameters
dataset_idstr: Dataset to delete.clientAPIClient | None: Optional API client.
Returns
None: None.
Raises
DatasetNotFoundError: If the dataset does not exist, or was already deleted.DatasetInUseError: If evaluation runs reference one of its versions, or another dataset was derived from it.ForbiddenError: If the caller lacks the workspace_admin or workspace_editor role.AuthError: If credentials are missing or invalid.
Examples:
try:
aip.delete_dataset("ds-abc123")
except aip.DatasetInUseError as err:
print(f"Still referenced by runs: {err.blocking_runs}")