code: def test_iter_batches_columns_reader(tempdir, batch_size):
      total_size = 3000
      chunk_size = 1000
      # TODO: Add categorical support
      df = alltypes_sample(size=total_size)
  
      filename = tempdir / "pandas_roundtrip.parquet"
      arrow_table = pa.Table.from_pandas(df)
      _write_table(
          arrow_table, filename, version="2.6", chunk_size=chunk_size
      )
  
      file_ = pq.ParquetFile(filename)
      for columns in [df.columns[:10], df.columns[10:]]:
          batches = file_.iter_batches(
              batch_size=batch_size, columns=columns
          )
          batch_starts = range(0, total_size + batch_size, batch_size)
          for batch, start in zip(batches, batch_starts):
              end = min(total_size, start + batch_size)
              tm.assert_frame_equal(
                  batch.to_pandas(),
                  df.iloc[start:end, :]
                  .loc[:, columns]
                  .reset_index(drop=True),
              )
  
file_path: arrow/python/pyarrow/tests/parquet/test_parquet_file.py
imports: import io
  import os
  import sys
  import pytest
  import pyarrow
label_desc: Use image node_id 9 for calling a global function with example usage: test_iter_batches_columns_reader(tempdir, batch_size) without return types