class_docstr: Tests for TopKUniquesSketchStatsGenerator.
class_docstr_tok: ["Tests","for","TopKUniquesSketchStatsGenerator","."]
code: def test_string_domain_categorization(
      self, schema, expected_partial_stats
  ):
      large_bytes = "f" * (sketch_generator._LARGE_STRING_THRESHOLD + 1)
      batches = [
          pa.RecordBatch.from_arrays(
              [
                  pa.array(
                      [
                          ["a", "b", large_bytes, "a"],
                          ["a", large_bytes, large_bytes, "a"],
                      ]
                  ),
              ],
              ["fa"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["c"]]),
              ],
              ["fa"],
          ),
      ]
      if schema:
          schema = text_format.Parse(schema, schema_pb2.Schema())
      expected_result = {}
      if expected_partial_stats:
          expected_result = {
              types.FeaturePath(["fa"]): text_format.Parse(
                  expected_partial_stats,
                  statistics_pb2.FeatureNameStatistics(),
              )
          }
      generator = sketch_generator.TopKUniquesSketchStatsGenerator(
          num_top_values=2,
          num_rank_histogram_buckets=2,
          schema=schema,
          length_counter_sampling_rate=1,
      )
      self.assertCombinerOutputEqual(
          batches, generator, expected_result
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  from absl.testing import parameterized
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import top_k_uniques_sketch_stats_generator
  from tensorflow_data_validation.utils import test_util
  from tensorflow_data_validation.utils.example_weight_map import ExampleWeightMap
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 19 for calling the TopKUniquesSketchStatsGeneratorTest obj's underlying member method code with example usage: obj.test_string_domain_categorization(schema, expected_partial_stats) without return types