

def delete_dataset(self, dataset_id, delete_contents=False):
    'Delete a BigQuery dataset.\n\n        Parameters\n        ----------\n        dataset_id : str\n            Unique ``str`` identifying the datset with the project (the\n            referenceId of the dataset)\n        delete_contents : bool, optional\n            If True, forces the deletion of the dataset even when the dataset\n            contains data (Default = False)\n\n        Returns\n        -------\n        Union[bool, dict[\n            ool indicating if the delete was successful or not, or response\n            from BigQuery if swallow_results is set for False\n\n        Raises\n        -------\n        HttpError\n            404 when dataset with dataset_id does not exist\n        '
    try:
        datasets = self.bigquery.datasets()
        request = datasets.delete(projectId=self.project_id, datasetId=dataset_id, deleteContents=delete_contents)
        response = request.execute()
        if self.swallow_results:
            return True
        else:
            return response
    except HttpError as e:
        logger.error('Cannot delete dataset {0}: {1}'.format(dataset_id, e))
        if self.swallow_results:
            return False
        else:
            return {
                
            }

dataset/ETHPy150Open tylertreat/BigQuery-Python/bigquery/client.py BigQueryClient.delete_dataset/original