code: def test_property_from_dict_with_errors():
      with pytest.raises(
          MlflowException,
          match=r"Expected Property JSON to contain a single key as name, got 2 keys.",
      ):
          Property.from_json_dict(**{"p1": {}, "p2": {}})
  
      with pytest.raises(
          MlflowException,
          match=r"Missing keys in Property `p`. Expected to find key `type`",
      ):
          Property.from_json_dict(**{"p": {}})
  
      with pytest.raises(
          MlflowException,
          match=r"Unsupported type 'invalid_type', expected instance of DataType, Array, Object or ",
      ):
          Property.from_json_dict(**{"p": {"type": "invalid_type"}})
  
      # test array
      with pytest.raises(
          MlflowException,
          match=r"Missing keys in Array JSON. Expected to find keys `items` and `type`",
      ):
          Property.from_json_dict(**{"p": {"type": "array"}})
  
      with pytest.raises(
          MlflowException,
          match=r"Unsupported type 'invalid_type', expected instance of DataType, Array, Object or ",
      ):
          Property.from_json_dict(
              **{
                  "p": {
                      "type": "array",
                      "items": {"type": "invalid_type"},
                  }
              }
          )
  
      with pytest.raises(
          MlflowException,
          match=r"Expected items to be a dictionary of Object JSON",
      ):
          Property.from_json_dict(
              **{"p": {"type": "array", "items": "invalid_items_type"}}
          )
  
      # test object
      with pytest.raises(
          MlflowException,
          match=r"Missing keys in Object JSON. Expected to find keys `properties` and `type`",
      ):
          Property.from_json_dict(**{"p": {"type": "object"}})
  
      with pytest.raises(
          MlflowException,
          match=r"Expected properties to be a dictionary of Property JSON",
      ):
          Property.from_json_dict(
              **{"p": {"type": "object", "properties": "invalid_type"}}
          )
  
      with pytest.raises(
          MlflowException,
          match=r"Expected properties to be a dictionary of Property JSON",
      ):
          Property.from_json_dict(
              **{
                  "p": {
                      "type": "object",
                      "properties": {
                          "p1": {"type": "string"},
                          "p2": "invalid_type",
                      },
                  }
              }
          )
  
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 36 for calling a global function with example usage: test_property_from_dict_with_errors() without return types