code: def test_conflicting_sparse_outputs_annotations(
      self, use_tf_compat_v1
  ):
      def preprocessing_fn(inputs):
          tft.experimental.annotate_sparse_output_shape(
              inputs["x"], [3]
          )
          tft.experimental.annotate_sparse_output_shape(
              inputs["x"], [17]
          )
          tft.experimental.annotate_true_sparse_output(inputs["x"])
          return inputs
  
      input_data_dicts = [dict(x=[1]) for x in range(10)]
      input_metadata = tft.DatasetMetadata.from_feature_spec(
          {
              "x": tf.io.VarLenFeature(tf.int64),
          }
      )
      schema = text_format.Parse(
          """
        feature {
          name: "x$sparse_indices_0"
          type: INT
          int_domain {
            min: 0
            max: 16
          }
        }
        feature {
          name: "x$sparse_values"
          type: INT
        }
        sparse_feature {
          name: "x"
          index_feature {
            name: "x$sparse_indices_0"
          }
          is_sorted: true
          value_feature {
            name: "x$sparse_values"
          }
        }
      """,
          schema_pb2.Schema(),
      )
      if not tft_unit.is_external_environment():
          schema.generate_legacy_feature_spec = False
      self.assertAnalyzeAndTransformResults(
          input_data_dicts,
          input_metadata,
          preprocessing_fn,
          expected_metadata=tft.DatasetMetadata(schema),
          force_tf_compat_v1=use_tf_compat_v1,
          output_record_batches=True,
      )
  
file_path: transform/tensorflow_transform/beam/annotators_test.py
imports: import tensorflow
  import tensorflow_transform
  from tensorflow_transform.beam import tft_unit
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 2 for calling the AnnotatorsTest obj's underlying member method code with example usage: obj.test_conflicting_sparse_outputs_annotations(use_tf_compat_v1) and returns: inputs