code: def testIsJsonCompatible(self):
      for typehint in (
          Dict[str, float],
          List[int],
          Dict[str, List[Dict[str, int]]],
          Optional[Dict[str, Dict[str, bool]]],
          Optional[Dict[str, Optional[List[int]]]],
          Union[Dict[str, int], type(None)],
          Union[Dict[str, str], List[bool]],
          Dict[str, Any],
          Dict[str, List[Any]],
          List[Any],
          List[Dict[str, Any]],
      ):
          self.assertTrue(is_json_compatible(typehint))
      for typehint in (
          # Bare primitives.
          dict,
          Dict,
          Union,
          # Invalid Dict, Union or List parameters.
          Dict[str, Dict],
          Dict[str, bytes],
          Dict[int, float],
          Union[Dict[str, int], float],
          List[bytes],
          List["Y"],
          # Primitive types.
          int,
          str,
          float,
          dict,
          bytes,
          bool,
          type(None),
          Any,
      ):
          self.assertFalse(is_json_compatible(typehint))
  
file_path: tfx/tfx/dsl/component/experimental/json_compat_test.py
imports: from typing import Any, Dict, List, Optional, Union
  import tensorflow
  from tfx.dsl.component.experimental.json_compat import check_strict_json_compat
  from tfx.dsl.component.experimental.json_compat import is_json_compatible
label_desc: Use image node_id 1 for calling the JsonCompatTest obj's underlying member method code with example usage: obj.testIsJsonCompatible() without return types