def create(self, bucket, descriptor, force=False):
        """https://github.com/frictionlessdata/tableschema-bigquery-py#storage
        """

        # Make lists
        buckets = bucket
        if isinstance(bucket, six.string_types):
            buckets = [bucket]
        descriptors = descriptor
        if isinstance(descriptor, dict):
            descriptors = [descriptor]

        # Iterate over buckets/descriptors
        for bucket, descriptor in zip(buckets, descriptors):

            # Existent bucket
            if bucket in self.buckets:
                if not force:
                    message = 'Bucket "%s" already exists' % bucket
                    raise tableschema.exceptions.StorageError(message)
                self.delete(bucket)

            # Prepare job body
            tableschema.validate(descriptor)
            table_name = self.__mapper.convert_bucket(bucket)
            converted_descriptor, fallbacks = self.__mapper.convert_descriptor(descriptor)
            body = {
                'tableReference': {
                    'projectId': self.__project,
                    'datasetId': self.__dataset,
                    'tableId': table_name,
                },
                'schema': converted_descriptor,
            }

            # Make request
            self.__service.tables().insert(
                projectId=self.__project,
                datasetId=self.__dataset,
                body=body).execute()

            # Add to descriptors/fallbacks
            self.__descriptors[bucket] = descriptor
            self.__fallbacks[bucket] = fallbacks

        # Remove buckets cache
        self.__buckets = None
def create ( self , bucket , descriptor , force = False ) : buckets = bucket if isinstance ( bucket , six . string_types ) : buckets = [ bucket ] descriptors = descriptor if isinstance ( descriptor , dict ) : descriptors = [ descriptor ] for bucket , descriptor in zip ( buckets , descriptors ) : if bucket in self . buckets : if not force : message = 'Bucket "%s" already exists' % bucket raise tableschema . exceptions . StorageError ( message ) self . delete ( bucket ) tableschema . validate ( descriptor ) table_name = self . __mapper . convert_bucket ( bucket ) converted_descriptor , fallbacks = self . __mapper . convert_descriptor ( descriptor ) body = { 'tableReference' : { 'projectId' : self . __project , 'datasetId' : self . __dataset , 'tableId' : table_name , } , 'schema' : converted_descriptor , } self . __service . tables ( ) . insert ( projectId = self . __project , datasetId = self . __dataset , body = body ) . execute ( ) self . __descriptors [ bucket ] = descriptor self . __fallbacks [ bucket ] = fallbacks self . __buckets = None
https://github.com/frictionlessdata/tableschema-bigquery-py#storage