code: def test_string_to_arrow_bijection_for_primitive_types(self):
      supported_pyarrow_datatypes = [
          pa.time32("s"),
          pa.time64("us"),
          pa.timestamp("s"),
          pa.timestamp("ns", tz="America/New_York"),
          pa.date32(),
          pa.date64(),
          pa.duration("s"),
          pa.decimal128(10, 2),
          pa.decimal256(40, -3),
          pa.string(),
          pa.int32(),
          pa.float64(),
          pa.array(
              [datetime.time(1, 1, 1)]
          ).type,  # arrow type: DataType(time64[us])
      ]
      for dt in supported_pyarrow_datatypes:
          self.assertEqual(
              dt, string_to_arrow(_arrow_to_datasets_dtype(dt))
          )
  
      unsupported_pyarrow_datatypes = [pa.list_(pa.float64())]
      for dt in unsupported_pyarrow_datatypes:
          with self.assertRaises(ValueError):
              string_to_arrow(_arrow_to_datasets_dtype(dt))
  
      supported_datasets_dtypes = [
          "time32[s]",
          "timestamp[ns]",
          "timestamp[ns, tz=+07:30]",
          "duration[us]",
          "decimal128(30, -4)",
          "int32",
          "float64",
      ]
      for sdt in supported_datasets_dtypes:
          self.assertEqual(
              sdt, _arrow_to_datasets_dtype(string_to_arrow(sdt))
          )
  
      unsupported_datasets_dtypes = [
          "time32[ns]",
          "timestamp[blob]",
          "timestamp[[ns]]",
          "timestamp[ns, tz=[ns]]",
          "duration[[us]]",
          "decimal20(30, -4)",
          "int",
      ]
      for sdt in unsupported_datasets_dtypes:
          with self.assertRaises(ValueError):
              string_to_arrow(sdt)
  
imports: import datetime
  from unittest import TestCase
  from unittest.mock import patch
  import numpy
  import pandas
  import pyarrow
  import pytest
  from datasets import Array2D
  from datasets.arrow_dataset import Dataset
  from datasets.features import Audio, ClassLabel, Features, Image, Sequence, Value
  from datasets.features.features import _arrow_to_datasets_dtype, _cast_to_python_objects, cast_to_python_objects, encode_nested_example, generate_from_dict, string_to_arrow
  from datasets.features.translation import Translation, TranslationVariableLanguages
  from datasets.info import DatasetInfo
  from datasets.utils.py_utils import asdict
  from ..utils import require_jax, require_tf, require_torch
label_desc: Use image node_id 3 for calling the FeaturesTest obj's underlying member method code with example usage: obj.test_string_to_arrow_bijection_for_primitive_types() without return types