class_docstr: Options for generating statistics.
class_docstr_tok: ["Options","for","generating","statistics","."]
docstr: Convert from an object to JSON representation of the __dict__ attribute.
  
  Custom generators and slice_functions cannot being converted. As a result,
  a ValueError will be raised when these options are specified and TFDV is
  running in a setting where the stats options have been json-serialized,
  first. This will happen in the case where TFDV is run as a TFX component.
  The schema proto and slicing_config will be json_encoded.
  
  Returns:
    A JSON representation of a filtered version of __dict__.
docstr_tok: ["Convert","from","an","object","to","JSON","representation","of","the","__dict__","attribute",".","Custom","generators","and","slice_functions","can","not","being","converted",".","As","a","result",",","a","ValueError","will","be","raised","when","these","options","are","specified","and","TFDV","is","running","in","a","setting","where","the","stats","options","have","been","json-serialized",",","first",".","This","will","happen","in","the","case","where","TFDV","is","run","as","a","TFX","component",".","The","schema","proto","and","slicing_config","will","be","json_encoded",".","Returns",":","A","JSON","representation","of","a","filtered","version","of","__dict__","."]
code: def to_json(self) -> Text:
      """Convert from an object to JSON representation of the __dict__ attribute.
  
      Custom generators and slice_functions cannot being converted. As a result,
      a ValueError will be raised when these options are specified and TFDV is
      running in a setting where the stats options have been json-serialized,
      first. This will happen in the case where TFDV is run as a TFX component.
      The schema proto and slicing_config will be json_encoded.
  
      Returns:
        A JSON representation of a filtered version of __dict__.
      """
      options_dict = copy.copy(self.__dict__)
      options_dict[_TYPE_NAME_KEY] = "StatsOptions"
      if options_dict["_slice_functions"] is not None:
          raise ValueError(
              "StatsOptions cannot be converted with experimental_slice_functions."
          )
      if options_dict["_generators"] is not None:
          raise ValueError(
              "StatsOptions cannot be converted with generators."
          )
      if self.schema is not None:
          del options_dict["_schema"]
          options_dict[_SCHEMA_JSON_KEY] = json_format.MessageToJson(
              self.schema
          )
      if self.slicing_config is not None:
          del options_dict["_slicing_config"]
          options_dict[
              _SLICING_CONFIG_JSON_KEY
          ] = json_format.MessageToJson(self.slicing_config)
      if self._per_feature_weight_override is not None:
          del options_dict["_per_feature_weight_override"]
          options_dict[_PER_FEATURE_WEIGHT_OVERRIDE_JSON_KEY] = {
              k.to_json(): v
              for k, v in self._per_feature_weight_override.items()
          }
      return json.dumps(options_dict)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import json
  import logging
  import types
  from typing import Dict, List, Optional, Text, Union
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import example_weight_map
  from tensorflow_data_validation.utils import schema_util
  from tensorflow_data_validation.utils import slicing_util
  from tfx_bsl.arrow import sql_util
  from tfx_bsl.coders import example_coder
  from tfx_bsl.public.proto import slicing_spec_pb2
  from google.protobuf import json_format
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 3 for calling the StatsOptions obj's underlying member method code with example usage: obj.to_json() and returns: json