class_docstr: Tests SamplePartition.
code: def test_sample_partition_combine(
      self,
      partitioned_record_batches,
      expected,
      sample_size,
      num_compacts,
  ):
      np.random.seed(TEST_SEED)
      p = beam.Pipeline()
      result = (
          p
          | beam.Create(partitioned_record_batches, reshuffle=False)
          | beam.CombinePerKey(
              partitioned_stats_generator._SampleRecordBatchRows(
                  sample_size
              )
          )
      )
  
      beam_test_util.assert_that(
          result, self._partition_matcher(expected)
      )
  
      # Validate metrics.
      np.random.seed(TEST_SEED)
      pipeline_result = p.run()
      pipeline_result.wait_until_finish()
      metrics = pipeline_result.metrics()
      num_compacts_metric = metrics.query(
          beam.metrics.metric.MetricsFilter().with_name(
              "sample_record_batch_rows_num_compacts"
          )
      )["counters"]
      metric_num_compacts = 0
      for metric in num_compacts_metric:
          metric_num_compacts += metric.committed
      if num_compacts_metric:
          self.assertEqual(metric_num_compacts, num_compacts)
  
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 apache_beam
  from apache_beam.testing import util
  import numpy
  import pyarrow
  from tensorflow_data_validation import constants
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import partitioned_stats_generator
  from tensorflow_data_validation.statistics.generators import sklearn_mutual_information
  from tensorflow_data_validation.utils import test_util
  from google.protobuf import text_format
  from tensorflow.python.util.protobuf import compare
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 2 for calling the SampleRecordBatchRows obj's underlying member method code with example usage: obj.test_sample_partition_combine(partitioned_record_batches, expected, sample_size, num_compacts) without return types