def _wait_for_job(self, job_id):
    while True:
        job_status = self.bulk.job_status(job_id)
        self.logger.info('    Waiting for job {} ({}/{})'.format(job_id, job_status['numberBatchesCompleted'], job_status['numberBatchesTotal']))
        result = self._job_state_from_batches(job_id)
        if (result != 'InProgress'):
            break
        time.sleep(10)
    self.logger.info('Job {} finished with result: {}'.format(job_id, result))
    return result
def _wait_for_job(self, job_id):
    while True:
        job_status = self.bulk.job_status(job_id)
        self.logger.info('    Waiting for job {} ({}/{})'.format(job_id, job_status['numberBatchesCompleted'], job_status['numberBatchesTotal']))
        result = self._job_state_from_batches(job_id)
        if (result != 'InProgress'):
            break
        time.sleep(10)
    self.logger.info('Job {} finished with result: {}'.format(job_id, result))
    return result