docstr: Tests match ratio where all valid values have the same format.
docstr_tok: ["Tests","match","ratio","where","all","valid","values","have","the","same","format","."]
code: def test_time_stats_generator_match_ratio_with_same_valid_format(
      self,
  ):
      """Tests match ratio where all valid values have the same format."""
      input_batches = [
          pa.array(
              [
                  ["2018-11-30", "2018-11-30", "2018-11-30"],
                  ["2018-11-30", "2018-11-30"],
              ]
          ),
          pa.array(
              [
                  ["not-valid", "not-valid", "not-valid"],
                  ["not-valid", "not-valid"],
              ]
          ),
      ]
      # Try generator with match_ratio 0.51 (should not create stats).
      generator = time_stats_generator.TimeStatsGenerator(
          match_ratio=0.51, values_threshold=5
      )
      self.assertCombinerOutputEqual(
          input_batches,
          generator,
          statistics_pb2.FeatureNameStatistics(),
      )
      # Try generator with match_ratio 0.49 (should create stats).
      generator = time_stats_generator.TimeStatsGenerator(
          match_ratio=0.49, values_threshold=5
      )
      self.assertCombinerOutputEqual(
          input_batches,
          generator,
          statistics_pb2.FeatureNameStatistics(
              custom_stats=[
                  statistics_pb2.CustomStatistic(
                      name="domain_info",
                      str="time_domain {string_format: '%Y-%m-%d'}",
                  ),
                  statistics_pb2.CustomStatistic(
                      name="time_match_ratio", num=0.50
                  ),
              ]
          ),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from unittest import mock
  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 time_stats_generator
  from tensorflow_data_validation.utils import test_util
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 8 for calling the TimeStatsGeneratorTest obj's underlying member method code with example usage: obj.test_time_stats_generator_match_ratio_with_same_valid_format() without return types