code: def test_conf_with_python_objects(self):
      spark = self.spark
  
      for value, expected in [(True, "true"), (False, "false")]:
          spark.conf.set("foo", value)
          self.assertEqual(spark.conf.get("foo"), expected)
  
      spark.conf.set("foo", 1)
      self.assertEqual(spark.conf.get("foo"), "1")
  
      with self.assertRaises(IllegalArgumentException):
          spark.conf.set("foo", None)
  
      with self.assertRaises(Exception):
          spark.conf.set("foo", Decimal(1))
  
      with self.assertRaises(PySparkTypeError) as pe:
          spark.conf.get(123)
  
      self.check_error(
          exception=pe.exception,
          error_class="NOT_STR",
          message_parameters={
              "arg_name": "key",
              "arg_type": "int",
          },
      )
  
      spark.conf.unset("foo")
  
file_path: spark/python/pyspark/sql/tests/test_conf.py
imports: from decimal import Decimal
  from pyspark.errors import IllegalArgumentException, PySparkTypeError
  from pyspark.testing.sqlutils import ReusedSQLTestCase
label_desc: Use image node_id 2 for calling the ConfTestsMixin obj's underlying member method code with example usage: obj.test_conf_with_python_objects() without return types