def test_batch_size_of_one():
    """Try if BatchingTableQueue can be used to retrieve row-by-row data (batch size of 1)"""
    batches = [_new_record_batch([i]) for i in range(3)]
    table = pa.Table.from_batches(batches)

    batcher = BatchingTableQueue(1)
    batcher.put(table)

    for _ in range(3):
        assert not batcher.empty()
        next_batch = batcher.get()
        assert 1 == next_batch.num_rows

    assert batcher.empty()
Try if BatchingTableQueue can be used to retrieve row-by-row data (batch size of 1)
petastorm/pyarrow_helpers/tests/test_batch_buffer.py