class_docstr: API for writing statistics to both sharded records and binary pb.
  
  This PTransform assumes that input represents sharded statistics, which are
  written directly. These statistics are also merged and written to a binary
  proto.
  
  Currently Experimental.
  
  TODO(b/202910677): After full migration to sharded stats, clean this up.
class_docstr_tok: ["API","for","writing","statistics","to","both","sharded","records","and","binary","pb",".","This","PTransform","assumes","that","input","represents","sharded","statistics",",","which","are","written","directly",".","These","statistics","are","also","merged","and","written","to","a","binary","proto",".","Currently","Experimental",".","TODO","(","b\/202910677",")",":","After","full","migration","to","sharded","stats",",","clean","this","up","."]
docstr: Initializes the transform.
  
  Args:
    binary_proto_path: Output path for writing statistics as a binary proto.
    records_path_prefix: File pattern for writing statistics to sharded
      records.
    columnar_path_prefix: Optional file pattern for writing statistics to
      columnar outputs. If provided, columnar outputs will be written when
      supported.
docstr_tok: ["Initializes","the","transform",".","Args",":","binary_proto_path",":","Output","path","for","writing","statistics","as","a","binary","proto",".","records_path_prefix",":","File","pattern","for","writing","statistics","to","sharded","records",".","columnar_path_prefix",":","Optional","file","pattern","for","writing","statistics","to","columnar","outputs",".","If","provided",",","columnar","outputs","will","be","written","when","supported","."]
code: def __init__(
      self,
      binary_proto_path: str,
      records_path_prefix: str,
      columnar_path_prefix: Optional[str] = None,
  ) -> None:
      """Initializes the transform.
  
      Args:
        binary_proto_path: Output path for writing statistics as a binary proto.
        records_path_prefix: File pattern for writing statistics to sharded
          records.
        columnar_path_prefix: Optional file pattern for writing statistics to
          columnar outputs. If provided, columnar outputs will be written when
          supported.
      """
      self._binary_proto_path = binary_proto_path
      self._records_path_prefix = records_path_prefix
      self._io_provider = artifacts_io_impl.get_io_provider()
      self._columnar_path_prefix = columnar_path_prefix
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import random
  from typing import Generator, Text, Optional
  import apache_beam
  import pyarrow
  from tensorflow_data_validation.utils import artifacts_io_impl
  from tensorflow_data_validation.statistics import stats_impl
  from tensorflow_data_validation.statistics import stats_options
  from tfx_bsl.statistics import merge_util
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 1 to create a new WriteStatisticsToRecordsAndBinaryFile object from inherited base classes: beam with example: obj = WriteStatisticsToRecordsAndBinaryFile(binary_proto_path, records_path_prefix, columnar_path_prefix)