class_docstr: A function used to read blocks from the :class:`~ray.data.Dataset`.
  
  Read tasks are generated by :meth:`~ray.data.datasource.Reader.get_read_tasks`,
  and return a list of ``ray.data.Block`` when called. Initial metadata about the read
  operation can be retrieved via ``get_metadata()`` prior to executing the
  read. Final metadata is returned after the read along with the blocks.
  
  Ray will execute read tasks in remote functions to parallelize execution.
  Note that the number of blocks returned can vary at runtime. For example,
  if a task is reading a single large file it can return multiple blocks to
  avoid running out of memory during the read.
  
  The initial metadata should reflect all the blocks returned by the read,
  e.g., if the metadata says ``num_rows=1000``, the read can return a single
  block of 1000 rows, or multiple blocks with 1000 rows altogether.
  
  The final metadata (returned with the actual block) reflects the exact
  contents of the block itself.
class_docstr_tok: ["A","function","used","to","read","blocks","from","the",":","class",":","`","~ray.data.Dataset","`",".","Read","tasks","are","generated","by",":","meth",":","`","~ray.data.datasource.Reader.get_read_tasks","`",",","and","return","a","list","of","``","ray.data.Block","``","when","called",".","Initial","metadata","about","the","read","operation","can","be","retrieved","via","``","get_metadata","(",")","``","prior","to","executing","the","read",".","Final","metadata","is","returned","after","the","read","along","with","the","blocks",".","Ray","will","execute","read","tasks","in","remote","functions","to","parallelize","execution",".","Note","that","the","number","of","blocks","returned","can","vary","at","runtime",".","For","example",",","if","a","task","is","reading","a","single","large","file","it","can","return","multiple","blocks","to","avoid","running","out","of","memory","during","the","read",".","The","initial","metadata","should","reflect","all","the","blocks","returned","by","the","read",",","e.g.",",","if","the","metadata","says","``","num_rows=1000","``",",","the","read","can","return","a","single","block","of","1000","rows",",","or","multiple","blocks","with","1000","rows","altogether",".","The","final","metadata","(","returned","with","the","actual","block",")","reflects","the","exact","contents","of","the","block","itself","."]
code: def __init__(
      self,
      read_fn: Callable[[], Iterable[Block]],
      metadata: BlockMetadata,
  ):
      self._metadata = metadata
      self._read_fn = read_fn
  
imports: import warnings
  from typing import Any, Callable, Iterable, List, Optional
  import numpy
  import ray
  from ray.data._internal.execution.interfaces import TaskContext
  from ray.data._internal.util import _check_pyarrow_version
  from ray.data.block import Block, BlockAccessor, BlockMetadata
  from ray.data.context import DataContext
  from ray.types import ObjectRef
  from ray.util.annotations import Deprecated, DeveloperAPI, PublicAPI
label_desc: Use image node_id 1 to create a new ReadTask object from inherited base classes: Callable with example: obj = ReadTask(read_fn, metadata)