def _create_job(self, obj):
    delete_rows = self._query_salesforce_for_records_to_delete(obj)
    if (not delete_rows):
        self.logger.info('  No {} objects found, skipping delete'.format(obj))
        return
    operation = ('hardDelete' if self.options['hardDelete'] else 'delete')
    delete_job = self.bulk.create_job(obj, operation)
    self.logger.info('  Deleting {} {} records'.format(len(delete_rows), obj))
    batch_num = 1
    for batch in self._upload_batches(delete_job, delete_rows):
        self.logger.info('    Uploaded batch {}'.format(batch))
        batch_num += 1
    self.bulk.close_job(delete_job)
    return delete_job
def _create_job(self, obj):
    delete_rows = self._query_salesforce_for_records_to_delete(obj)
    if (not delete_rows):
        self.logger.info('  No {} objects found, skipping delete'.format(obj))
        return
    operation = ('hardDelete' if self.options['hardDelete'] else 'delete')
    delete_job = self.bulk.create_job(obj, operation)
    self.logger.info('  Deleting {} {} records'.format(len(delete_rows), obj))
    batch_num = 1
    for batch in self._upload_batches(delete_job, delete_rows):
        self.logger.info('    Uploaded batch {}'.format(batch))
        batch_num += 1
    self.bulk.close_job(delete_job)
    return delete_job