class_docstr: TFRecord datasource, for reading and writing TFRecord files.
class_docstr_tok: ["TFRecord","datasource",",","for","reading","and","writing","TFRecord","files","."]
code: def _read_stream(
      self, f: "pyarrow.NativeFile", path: str
  ) -> Iterator[Block]:
      import pyarrow as pa
      import tensorflow as tf
      from google.protobuf.message import DecodeError
  
      for record in _read_records(f, path):
          example = tf.train.Example()
          try:
              example.ParseFromString(record)
          except DecodeError as e:
              raise ValueError(
                  "`TFRecordDatasource` failed to parse `tf.train.Example` "
                  f"record in '{path}'. This error can occur if your TFRecord "
                  f"file contains a message type other than `tf.train.Example`: {e}"
              )
  
          yield pa.Table.from_pydict(
              _convert_example_to_dict(example, self.tf_schema)
          )
  
file_path: ray/python/ray/data/datasource/tfrecords_datasource.py
imports: import struct
  from typing import TYPE_CHECKING, Dict, Iterable, Iterator, List, Optional, Union
  import numpy
  from ray.data.block import Block
  from ray.data.datasource.file_based_datasource import FileBasedDatasource
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 2 for calling the TFRecordDatasource obj's underlying member method code with example usage: obj._read_stream(f, path) without return types