def _query_salesforce_for_records_to_delete(self, obj):
    self.logger.info('  Querying for all {} objects'.format(obj))
    query_job = self.bulk.create_query_job(obj, contentType='CSV')
    batch = self.bulk.query(query_job, 'select Id from {}'.format(obj))
    while (not self.bulk.is_batch_done(batch, query_job)):
        time.sleep(10)
    self.bulk.close_job(query_job)
    delete_rows = []
    for result in self.bulk.get_all_results_for_query_batch(batch, query_job):
        reader = unicodecsv.DictReader(result, encoding='utf-8')
        for row in reader:
            delete_rows.append(row)
    return delete_rows
def _query_salesforce_for_records_to_delete(self, obj):
    self.logger.info('  Querying for all {} objects'.format(obj))
    query_job = self.bulk.create_query_job(obj, contentType='CSV')
    batch = self.bulk.query(query_job, 'select Id from {}'.format(obj))
    while (not self.bulk.is_batch_done(batch, query_job)):
        time.sleep(10)
    self.bulk.close_job(query_job)
    delete_rows = []
    for result in self.bulk.get_all_results_for_query_batch(batch, query_job):
        reader = unicodecsv.DictReader(result, encoding='utf-8')
        for row in reader:
            delete_rows.append(row)
    return delete_rows