docstr: Tests that generator invalidates stats if there is a non-utf8 string.
docstr_tok: ["Tests","that","generator","invalidates","stats","if","there","is","a","non-utf8","string","."]
code: def test_time_stats_generator_utf8_check(self):
      """Tests that generator invalidates stats if there is a non-utf8 string."""
      # Absent invalidation, this is expected to give 6 matches.
      input_batches = [
          pa.array(
              [
                  ["2018-11-30", "2018-11-30", "2018-11-30"],
                  ["2018-11-30"],
              ]
          ),
          pa.array([["2018-11-30", "2018-11-30"]]),
          # Non utf-8 string that will invalidate the accumulator.
          pa.array([[b"\xF0"]]),
      ]
      # No domain_info should be generated as the non-utf8 string should
      # invalidate the stats. Absent this type issue, these examples would
      # satisfy the specified match_ratio and values_threshold.
      generator = time_stats_generator.TimeStatsGenerator(
          match_ratio=0.5, values_threshold=1
      )
      self.assertCombinerOutputEqual(
          input_batches,
          generator,
          statistics_pb2.FeatureNameStatistics(),
      )
  
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 4 for calling the TimeStatsGeneratorTest obj's underlying member method code with example usage: obj.test_time_stats_generator_utf8_check() without return types