class_docstr: A base class for data source readers. Data source readers are responsible for
  outputting data from a data source.
  
  .. versionadded: 4.0.0
docstr: Generates data for a given partition and returns an iterator of tuples or rows.
  
  This method is invoked once per partition to read the data. Implementing
  this method is required for readable data sources. You can initialize any
  non-serializable resources required for reading data from the data source
  within this method.
  
  Parameters
  ----------
  partition : object
      The partition to read. It must be one of the partition values returned by
      ``partitions()``.
  
  Returns
  -------
  Iterator[Tuple] or Iterator[Row]
      An iterator of tuples or rows. Each tuple or row will be converted to a row
      in the final DataFrame.
  
  Examples
  --------
  Yields a list of tuples:
  
  >>> def read(self, partition: InputPartition):
  ...     yield (partition.value, 0)
  ...     yield (partition.value, 1)
  
  Yields a list of rows:
  
  >>> def read(self, partition: InputPartition):
  ...     yield Row(partition=partition.value, value=0)
  ...     yield Row(partition=partition.value, value=1)
code: def read(
      self, partition: InputPartition
  ) -> Iterator[Union[Tuple, Row]]:
      """
      Generates data for a given partition and returns an iterator of tuples or rows.
  
      This method is invoked once per partition to read the data. Implementing
      this method is required for readable data sources. You can initialize any
      non-serializable resources required for reading data from the data source
      within this method.
  
      Parameters
      ----------
      partition : object
          The partition to read. It must be one of the partition values returned by
          ``partitions()``.
  
      Returns
      -------
      Iterator[Tuple] or Iterator[Row]
          An iterator of tuples or rows. Each tuple or row will be converted to a row
          in the final DataFrame.
  
      Examples
      --------
      Yields a list of tuples:
  
      >>> def read(self, partition: InputPartition):
      ...     yield (partition.value, 0)
      ...     yield (partition.value, 1)
  
      Yields a list of rows:
  
      >>> def read(self, partition: InputPartition):
      ...     yield Row(partition=partition.value, value=0)
      ...     yield Row(partition=partition.value, value=1)
      """
      ...
  
imports: from abc import ABC, abstractmethod
  from collections import UserDict
  from typing import Any, Dict, Iterator, List, Sequence, Tuple, Type, Union, TYPE_CHECKING
  from pyspark.sql import Row
  from pyspark.sql.types import StructType
  from pyspark.errors import PySparkNotImplementedError
label_desc: Use image node_id 2 for calling the DataSourceReader obj's underlying member method code with example usage: obj.read(partition) without return types