code: def testModelSignaturesDoFnError(self):
      export_path = self.createModelWithInvalidOutputShape()
      output_keypath = [constants.PREDICTIONS_KEY]
      signature_names = {"": [None]}
      eval_shared_models = {
          "": self.createTestEvalSharedModel(
              eval_saved_model_path=export_path,
              tags=[tf.saved_model.SERVING],
          )
      }
      model_specs = [config_pb2.ModelSpec()]
      schema = self.createDenseInputsSchema()
      tfx_io = tf_example_record.TFExampleBeamRecord(
          physical_format="text",
          schema=schema,
          raw_record_column_name=constants.ARROW_INPUT_COLUMN,
      )
  
      examples = [
          self._makeExample(input_1=1.0, input_2=2.0),
          self._makeExample(input_1=3.0, input_2=4.0),
          self._makeExample(input_1=5.0, input_2=6.0),
      ]
  
      with self.assertRaisesRegex(
          ValueError,
          "First dimension does not correspond with batch size.",
      ):
          with beam.Pipeline() as pipeline:
              # pylint: disable=no-value-for-parameter
              _ = (
                  pipeline
                  | "Create"
                  >> beam.Create(
                      [e.SerializeToString() for e in examples]
                  )
                  | "BatchExamples" >> tfx_io.BeamSource(batch_size=3)
                  | "ToExtracts" >> beam.Map(_record_batch_to_extracts)
                  | "ModelSignatures"
                  >> beam.ParDo(
                      model_util.ModelSignaturesDoFn(
                          model_specs=model_specs,
                          eval_shared_models=eval_shared_models,
                          output_keypath=output_keypath,
                          signature_names=signature_names,
                          default_signature_names=None,
                          prefer_dict_outputs=False,
                      )
                  )
              )
  
imports: import tempfile
  import unittest
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import util
  from tfx_bsl.tfxio import tf_example_record
  from google.protobuf import text_format
  from tensorflow.core.protobuf import saved_model_pb2
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 25 for calling the ModelUtilTest obj's underlying member method code with example usage: obj.testModelSignaturesDoFnError() without return types