code: def test_schema_inference_on_dataframe(pandas_df_with_all_types):
      basic_types = pandas_df_with_all_types.drop(
          columns=["boolean_ext", "integer_ext", "string_ext"]
      )
      schema = _infer_schema(basic_types)
      assert schema == Schema(
          [ColSpec(x, x) for x in basic_types.columns]
      )
  
      ext_types = pandas_df_with_all_types[
          ["boolean_ext", "integer_ext", "string_ext"]
      ].copy()
      expected_schema = Schema(
          [
              ColSpec(DataType.boolean, "boolean_ext"),
              ColSpec(DataType.long, "integer_ext"),
              ColSpec(DataType.string, "string_ext"),
          ]
      )
      schema = _infer_schema(ext_types)
      assert schema == expected_schema
  
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 9 for calling a global function with example usage: test_schema_inference_on_dataframe(pandas_df_with_all_types) without return types