class_docstr: Read a CSV file in batches.
class_docstr_tok: ["Read","a","CSV","file","in","batches","."]
docstr: Read `n` batches from the reader.
  
  The `n` chunks will be parallelized over the
  available threads.
  
  Parameters
  ----------
  n
      Number of chunks to fetch.
      This is ideally >= number of threads
  
  Examples
  --------
  >>> reader = pl.read_csv_batched(
  ...     "./tpch/tables_scale_100/lineitem.tbl",
  ...     separator="|",
  ...     try_parse_dates=True,
  ... )  # doctest: +SKIP
  >>> reader.next_batches(5)  # doctest: +SKIP
  
  Returns
  -------
  list of DataFrames
docstr_tok: ["Read","`","n","`","batches","from","the","reader",".","The","`","n","`","chunks","will","be","parallelized","over","the","available","threads",".","Parameters","--","--","--","--","--","n","Number","of","chunks","to","fetch",".","This","is","ideally",">","=","number","of","threads","Examples","--","--","--","--",">",">",">","reader","=","pl.read_csv_batched","(","...","``",".\/tpch\/tables_scale_100\/lineitem.tbl","''",",","...","separator=","''","|","''",",","...","try_parse_dates=True",",","...",")","#","doctest",":","+SKIP",">",">",">","reader.next_batches","(","5",")","#","doctest",":","+SKIP","Returns","--","--","--","-","list","of","DataFrames"]
code: def next_batches(self, n: int) -> list[DataFrame] | None:
      """
      Read `n` batches from the reader.
  
      The `n` chunks will be parallelized over the
      available threads.
  
      Parameters
      ----------
      n
          Number of chunks to fetch.
          This is ideally >= number of threads
  
      Examples
      --------
      >>> reader = pl.read_csv_batched(
      ...     "./tpch/tables_scale_100/lineitem.tbl",
      ...     separator="|",
      ...     try_parse_dates=True,
      ... )  # doctest: +SKIP
      >>> reader.next_batches(5)  # doctest: +SKIP
  
      Returns
      -------
      list of DataFrames
  
      """
      batches = self._reader.next_batches(n)
      if batches is not None:
          if self.new_columns:
              return [
                  _update_columns(wrap_df(df), self.new_columns)
                  for df in batches
              ]
          else:
              return [wrap_df(df) for df in batches]
      return None
  
file_path: polars/py-polars/polars/io/csv/batched_reader.py
imports: from __future__ import annotations
  import contextlib
  from pathlib import Path
  from typing import TYPE_CHECKING, Sequence
  from polars.datatypes import N_INFER_DEFAULT, py_type_to_dtype
  from polars.io.csv._utils import _update_columns
  from polars.utils._wrap import wrap_df
  from polars.utils.various import _prepare_row_count_args, _process_null_values, handle_projection_columns, normalize_filepath
label_desc: Use image node_id 2 for calling the BatchedCsvReader obj's underlying member method code with example usage: obj.next_batches(n) and returns: None, unknown, unknown