code: def test_stats_gen_with_csv_with_schema(self):
      records = ["feature1", "1"]
      input_data_path = self._write_records_to_csv(
          records, self._get_temp_dir(), "input_data.csv"
      )
      schema = text_format.Parse(
          """
          feature { name: "feature1" type: BYTES }
          """,
          schema_pb2.Schema(),
      )
  
      expected_result = text_format.Parse(
          """
      datasets {
    num_examples: 1
    features {
      path {
        step: "feature1"
      }
      type: STRING
      string_stats {
        common_stats {
          num_non_missing: 1
          min_num_values: 1
          max_num_values: 1
          avg_num_values: 1.0
          tot_num_values: 1
        }
        unique: 1
        top_values {
          value: "1"
          frequency: 1.0
        }
        avg_length: 1.0
        rank_histogram {
          buckets {
            label: "1"
            sample_count: 1.0
          }
        }
      }
    }
      }
      """,
          statistics_pb2.DatasetFeatureStatisticsList(),
      )
  
      self._default_stats_options.schema = schema
      self._default_stats_options.infer_type_from_schema = True
      result = stats_gen_lib.generate_statistics_from_csv(
          data_location=input_data_path,
          delimiter=",",
          stats_options=self._default_stats_options,
      )
      compare_fn = (
          test_util.make_dataset_feature_stats_list_proto_equal_fn(
              self, expected_result, check_histograms=False
          )
      )
      compare_fn([result])
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import gzip
  import os
  import tempfile
  from absl.testing import absltest
  from absl.testing import parameterized
  from apache_beam.io.filesystem import CompressionTypes
  import pandas
  import tensorflow
  from tensorflow_data_validation.statistics import stats_options
  from tensorflow_data_validation.utils import stats_gen_lib
  from tensorflow_data_validation.utils import test_util
  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 12 for calling the StatsGenTest obj's underlying member method code with example usage: obj.test_stats_gen_with_csv_with_schema() without return types