code: def test_enabling_autologging_throws_for_wrong_spark_version(
      spark_session, mock_get_current_listener
  ):
      # pylint: disable=unused-argument
      with mock.patch(
          "mlflow._spark_autologging._get_spark_major_version",
          return_value=2,
      ):
          with pytest.raises(
              MlflowException,
              match="Spark autologging unsupported for Spark versions < 3",
          ):
              mlflow.spark.autolog()
  
file_path: mlflow/tests/spark/autologging/datasource/test_spark_datasource_autologging_unit.py
imports: from unittest import mock
  import pytest
  import mlflow
  import mlflow.spark
  from mlflow._spark_autologging import PythonSubscriber, _get_current_listener
  from mlflow.exceptions import MlflowException
  from tests.spark.autologging.utils import _get_or_create_spark_session
label_desc: Use image node_id 5 for calling a global function with example usage: test_enabling_autologging_throws_for_wrong_spark_version(spark_session, mock_get_current_listener) without return types