code: def test_convert_for_predict_invalid_output_example_spec(
      self, input_key
  ):
      example = text_format.Parse(
          """
        features {
          feature { key: "predict_input" value: { bytes_list: { value: "feature" } } }
        }""",
          tf.train.Example(),
      )
      prediction_log = text_format.Parse(
          """
        predict_log {
          request {
            inputs {
              key: "%s"
              value {
                dtype: DT_STRING
                tensor_shape { dim { size: 1 } }
              }
            }
         }
         response {
           outputs {
             key: "output_float"
             value {
               dtype: DT_FLOAT
               tensor_shape { dim { size: 1 } dim { size: 2 }}
               float_val: 0.1
               float_val: 0.2
             }
           }
           outputs {
             key: "output_bytes"
             value {
               dtype: DT_STRING
               tensor_shape { dim { size: 1 }}
               string_val: "prediction"
             }
           }
         }
       }
      """
          % input_key,
          prediction_log_pb2.PredictionLog(),
      )
  
      # The ending quote cannot be recognized correctly when `string_val` field
      # is directly set with a serialized string quoted in the text format.
      prediction_log.predict_log.request.inputs[
          input_key
      ].string_val.append(example.SerializeToString())
  
      output_example_spec = text_format.Parse(
          """
          output_columns_spec {
          }
      """,
          bulk_inferrer_pb2.OutputExampleSpec(),
      )
      with self.assertRaises(ValueError):
          utils.convert(prediction_log, output_example_spec)
  
file_path: tfx/tfx/components/bulk_inferrer/prediction_to_example_utils_test.py
imports: from absl.testing import parameterized
  import tensorflow
  from tfx.components.bulk_inferrer import prediction_to_example_utils
  from tfx.proto import bulk_inferrer_pb2
  from google.protobuf import text_format
  from tensorflow_serving.apis import prediction_log_pb2
label_desc: Use image node_id 7 for calling the PredictionToExampleUtilsTest obj's underlying member method code with example usage: obj.test_convert_for_predict_invalid_output_example_spec(input_key) without return types