code: def testPrimitiveTypeGenericAnnotation(self):
      # Error: type hint whose parameter is not a primitive type
      # pytype: disable=unsupported-operands
      with self.assertRaisesRegex(
          ValueError, "T to be `int`, `float`, `str`, `bool`"
      ):
          _ = annotations._PrimitiveTypeGeneric[artifact.Artifact]
      with self.assertRaisesRegex(
          ValueError, "T to be `int`, `float`, `str`, `bool`"
      ):
          _ = annotations._PrimitiveTypeGeneric[object]
      with self.assertRaisesRegex(
          ValueError, "T to be `int`, `float`, `str`, `bool`"
      ):
          _ = annotations._PrimitiveTypeGeneric[123]
      with self.assertRaisesRegex(
          ValueError, "T to be `int`, `float`, `str`, `bool`"
      ):
          _ = annotations._PrimitiveTypeGeneric["string"]
      with self.assertRaisesRegex(
          ValueError, "T to be `int`, `float`, `str`, `bool`"
      ):
          _ = annotations._PrimitiveTypeGeneric[Dict[int, int]]
      with self.assertRaisesRegex(
          ValueError, "T to be `int`, `float`, `str`, `bool`"
      ):
          _ = annotations._PrimitiveTypeGeneric[bytes]
      # pytype: enable=unsupported-operands
      # OK.
      _ = annotations._PrimitiveTypeGeneric[int]
      _ = annotations._PrimitiveTypeGeneric[float]
      _ = annotations._PrimitiveTypeGeneric[str]
      _ = annotations._PrimitiveTypeGeneric[bool]
      _ = annotations._PrimitiveTypeGeneric[Dict[str, float]]
      _ = annotations._PrimitiveTypeGeneric[bool]
  
file_path: tfx/tfx/dsl/component/experimental/annotations_test.py
imports: from typing import Dict
  import apache_beam
  import tensorflow
  from tfx.dsl.component.experimental import annotations
  from tfx.types import artifact
  from tfx.types import standard_artifacts
  from tfx.types import value_artifact
label_desc: Use image node_id 3 for calling the AnnotationsTest obj's underlying member method code with example usage: obj.testPrimitiveTypeGenericAnnotation() without return types