code: def testProtoTypeCheck(self):
      param = data_types.RuntimeParameter(name="split-1", ptype=str)
      # Dict representation of a example_gen_pb2.Input proto message.
      # The second split has int-typed pattern, which is wrong.
      proto = dict(
          splits=[
              dict(name=param, pattern="pattern1"),
              dict(name="name2", pattern=42),
              dict(name="name3", pattern="pattern3"),
          ]
      )
      input_channel = Channel(type=_InputArtifact)
      output_channel = Channel(type=_OutputArtifact)
  
      with self.assertRaisesRegex(
          ParseError,
          "Failed to parse .* field: expected string or "
          "(bytes-like object|buffer)",
      ):
          _ = _BasicComponentSpec(
              folds=10,
              proto=proto,
              input=input_channel,
              output=output_channel,
          )
  
imports: from typing import Dict, List
  import tensorflow
  from tfx.orchestration import data_types
  from tfx.proto import example_gen_pb2
  from tfx.types.artifact import Artifact
  from tfx.types.channel import Channel
  from tfx.types.component_spec import ChannelParameter
  from tfx.types.component_spec import ComponentSpec
  from tfx.types.component_spec import ExecutionParameter
  from google.protobuf.json_format import ParseError
label_desc: Use image node_id 2 for calling the DataTypesTest obj's underlying member method code with example usage: obj.testProtoTypeCheck() without return types