def initialize_spark_session(self):
        """
        Initialize the spark session with serverless compute.
        This method is called when the spark session is not active.
        """
        _validate_databricks_connect_available()

        from databricks.connect.session import DatabricksSession as SparkSession

        if self.profile:
            builder = SparkSession.builder.profile(self.profile).serverless(True)
        elif self.client is not None:
            config = self.client.config
            config.as_dict().pop("cluster_id", None)
            config.serverless_compute_id = "auto"  # Setting Serverless to true by adding "auto"
            builder = SparkSession.builder.sdkConfig(config)
        else:
            builder = SparkSession.builder.serverless(True)
        self.spark = builder.getOrCreate()

        Initialize the spark session with serverless compute.
        This method is called when the spark session is not active.
        
ai/core/src/unitycatalog/ai/core/databricks.py