code: def test_schema_inference_on_pandas_series():
      # test objects
      schema = _infer_schema(pd.Series(np.array(["a"], dtype=object)))
      assert schema == Schema([ColSpec(DataType.string)])
      schema = _infer_schema(
          pd.Series(np.array([bytes([1])], dtype=object))
      )
      assert schema == Schema([ColSpec(DataType.binary)])
      schema = _infer_schema(
          pd.Series(
              np.array([bytearray([1]), None], dtype=object),
              name="input",
          )
      )
      assert schema == Schema(
          [ColSpec(DataType.binary, name="input", required=False)]
      )
      schema = _infer_schema(
          pd.Series(np.array([1.1, None], dtype=object), name="input")
      )
      assert schema == Schema(
          [ColSpec(DataType.double, name="input", required=False)]
      )
  
      # test bytes
      schema = _infer_schema(
          pd.Series(np.array([bytes([1])], dtype=np.bytes_))
      )
      assert schema == Schema([ColSpec(DataType.binary)])
  
      # test string
      schema = _infer_schema(pd.Series(np.array(["a"], dtype=str)))
      assert schema == Schema([ColSpec(DataType.string)])
  
      # test boolean
      schema = _infer_schema(pd.Series(np.array([True], dtype=bool)))
      assert schema == Schema([ColSpec(DataType.boolean)])
  
      # test ints
      for t in [np.uint8, np.uint16, np.int8, np.int16, np.int32]:
          schema = _infer_schema(
              pd.Series(np.array([1, 2, 3], dtype=t))
          )
          assert schema == Schema([ColSpec("integer")])
  
      # test longs
      for t in [np.uint32, np.int64]:
          schema = _infer_schema(
              pd.Series(np.array([1, 2, 3], dtype=t))
          )
          assert schema == Schema([ColSpec("long")])
  
      # unsigned long is unsupported
      with pytest.raises(
          MlflowException, match="Unsupported numpy data type"
      ):
          _infer_schema(pd.Series(np.array([1, 2, 3], dtype=np.uint64)))
  
      # test floats
      for t in [np.float16, np.float32]:
          schema = _infer_schema(
              pd.Series(np.array([1.1, 2.2, 3.3], dtype=t))
          )
          assert schema == Schema([ColSpec("float")])
  
      # test doubles
      schema = _infer_schema(
          pd.Series(np.array([1.1, 2.2, 3.3], dtype=np.float64))
      )
      assert schema == Schema([ColSpec("double")])
  
      # test datetime
      schema = _infer_schema(
          pd.Series(
              np.array(
                  [
                      "2021-01-01 00:00:00",
                      "2021-02-02 00:00:00",
                      "2021-03-03 12:00:00",
                  ],
                  dtype="datetime64",
              )
          )
      )
      assert schema == Schema([ColSpec("datetime")])
  
      # unsupported
      if hasattr(np, "float128"):
          with pytest.raises(
              MlflowException, match="Unsupported numpy data type"
          ):
              _infer_schema(
                  pd.Series(np.array([1, 2, 3], dtype=np.float128))
              )
  
      # test names
      s = pd.Series([1, 2, 3])
      if hasattr(s, "name"):
          s.rename("test", inplace=True)
          assert "test" in _infer_schema(s).input_names()
          assert len(_infer_schema(s).input_names()) == 1
  
imports: import datetime
  import json
  import math
  import re
  import numpy
  import pandas
  import pyspark
  import pyspark.sql.types
  import pytest
  from scipy.sparse import csc_matrix, csr_matrix
  from mlflow.exceptions import MlflowException
  from mlflow.models.utils import _enforce_tensor_spec
  from mlflow.pyfunc import _parse_spark_datatype
  from mlflow.types import DataType
  from mlflow.types.schema import Array, ColSpec, Object, ParamSchema, ParamSpec, Property, Schema, TensorSpec
  from mlflow.types.utils import _get_tensor_shape, _infer_colspec_type, _infer_param_schema, _infer_schema, _validate_input_dictionary_contains_only_strings_and_lists_of_strings
label_desc: Use image node_id 10 for calling a global function with example usage: test_schema_inference_on_pandas_series() without return types