def make_dataset(self, dataset, raise_if_exists=False, body=None):
        """Creates a new dataset with the default permissions.

           :param dataset:
           :type dataset: BQDataset
           :param raise_if_exists: whether to raise an exception if the dataset already exists.
           :raises luigi.target.FileAlreadyExists: if raise_if_exists=True and the dataset exists
        """

        if body is None:
            body = {}

        try:
            # Construct a message body in the format required by
            # https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/python/latest/bigquery_v2.datasets.html#insert
            body['datasetReference'] = {
                'projectId': dataset.project_id,
                'datasetId': dataset.dataset_id
            }
            if dataset.location is not None:
                body['location'] = dataset.location
            self.client.datasets().insert(projectId=dataset.project_id, body=body).execute()
        except http.HttpError as ex:
            if ex.resp.status == 409:
                if raise_if_exists:
                    raise luigi.target.FileAlreadyExists()
            else:
                raise
def make_dataset ( self , dataset , raise_if_exists = False , body = None ) : if body is None : body = { } try : body [ 'datasetReference' ] = { 'projectId' : dataset . project_id , 'datasetId' : dataset . dataset_id } if dataset . location is not None : body [ 'location' ] = dataset . location self . client . datasets ( ) . insert ( projectId = dataset . project_id , body = body ) . execute ( ) except http . HttpError as ex : if ex . resp . status == 409 : if raise_if_exists : raise luigi . target . FileAlreadyExists ( ) else : raise
Creates a new dataset with the default permissions.

           :param dataset:
           :type dataset: BQDataset
           :param raise_if_exists: whether to raise an exception if the dataset already exists.
           :raises luigi.target.FileAlreadyExists: if raise_if_exists=True and the dataset exists