code: def test_strict_schema(ray_start_regular_shared):
      import pyarrow as pa
  
      from ray.data._internal.pandas_block import PandasBlockSchema
      from ray.data.extensions.tensor_extension import ArrowTensorType
  
      ds = ray.data.from_items([{"x": 2}])
      schema = ds.schema()
      assert isinstance(schema.base_schema, pa.lib.Schema)
      assert schema.names == ["x"]
      assert schema.types == [pa.int64()]
  
      ds = ray.data.from_items([{"x": 2, "y": [1, 2]}])
      schema = ds.schema()
      assert isinstance(schema.base_schema, pa.lib.Schema)
      assert schema.names == ["x", "y"]
      assert schema.types == [pa.int64(), pa.list_(pa.int64())]
  
      ds = ray.data.from_items([{"x": 2, "y": object(), "z": [1, 2]}])
      schema = ds.schema()
      assert schema.names == ["x", "y", "z"]
      assert schema.types == [
          pa.int64(),
          object,
          object,
      ]
  
      ds = ray.data.from_numpy(np.ones((100, 10)))
      schema = ds.schema()
      assert isinstance(schema.base_schema, pa.lib.Schema)
      assert schema.names == ["data"]
      assert schema.types == [
          ArrowTensorType(shape=(10,), dtype=pa.float64())
      ]
  
      schema = ds.map_batches(
          lambda x: x, batch_format="pandas"
      ).schema()
      assert isinstance(schema.base_schema, PandasBlockSchema)
      assert schema.names == ["data"]
      assert schema.types == [
          ArrowTensorType(shape=(10,), dtype=pa.float64())
      ]
  
file_path: ray/python/ray/data/tests/test_strict_mode.py
imports: from collections import UserDict
  import numpy
  import pytest
  import ray
  from ray.data.tests.conftest import *
  from ray.tests.conftest import *
label_desc: Use image node_id 10 for calling a global function with example usage: test_strict_schema(ray_start_regular_shared) without return types