def _store_inserted_ids(self, mapping, job_id, local_ids_for_batch):
    'Get the job results and store inserted SF Ids in a new table'
    id_table_name = self._reset_id_table(mapping)
    conn = self.session.connection()
    for (batch_id, local_ids) in local_ids_for_batch.items():
        try:
            results_url = '{}/job/{}/batch/{}/result'.format(self.bulk.endpoint, job_id, batch_id)
            with _download_file(results_url, self.bulk) as f:
                self.logger.info('  Downloaded results for batch {}'.format(batch_id))
                self._store_inserted_ids_for_batch(f, local_ids, id_table_name, conn)
            self.logger.info('  Updated {} for batch {}'.format(id_table_name, batch_id))
        except Exception:
            self.logger.error('Could not download batch results: {}'.format(batch_id))
            continue
    self.session.commit()
Get the job results and store inserted SF Ids in a new table
def _store_inserted_ids(self, mapping, job_id, local_ids_for_batch):
    
    id_table_name = self._reset_id_table(mapping)
    conn = self.session.connection()
    for (batch_id, local_ids) in local_ids_for_batch.items():
        try:
            results_url = '{}/job/{}/batch/{}/result'.format(self.bulk.endpoint, job_id, batch_id)
            with _download_file(results_url, self.bulk) as f:
                self.logger.info('  Downloaded results for batch {}'.format(batch_id))
                self._store_inserted_ids_for_batch(f, local_ids, id_table_name, conn)
            self.logger.info('  Updated {} for batch {}'.format(id_table_name, batch_id))
        except Exception:
            self.logger.error('Could not download batch results: {}'.format(batch_id))
            continue
    self.session.commit()