def __iter__(self): records = [] size = 0 for record in input_readers.RecordsReader.__iter__(self): records.append(record) size += len(record) if size > self.BATCH_SIZE: yield records size = 0 records = [] gc.collect() if records: yield records
def __iter__(self): records = [] size = 0 for record in input_readers.RecordsReader.__iter__(self): records.append(record) size += len(record) if size > self.BATCH_SIZE: yield records size = 0 records = [] gc.collect() if records: yield records