code: def test_spark_sklearn_autologging_context_provider(
      spark_session, data_format, file_path
  ):
      mlflow.spark.autolog()
      mlflow.sklearn.autolog()
  
      df = (
          spark_session.read.format(data_format)
          .option("header", "true")
          .option("inferSchema", "true")
          .load(file_path)
          .select("number1", "number2")
      )
      pandas_df = df.toPandas()
  
      # DF info should be logged to the first run (it should be added to our context provider after
      # the toPandas() call above & then logged here)
      with mlflow.start_run():
          run = _fit_sklearn_model(pandas_df)
      _assert_spark_data_logged(run, file_path, data_format)
  
      with mlflow.start_run():
          pandas_df2 = df.filter("number1 > 0").toPandas()
          run2 = _fit_sklearn_model(pandas_df2)
      assert run2.info.run_id != run.info.run_id
      _assert_spark_data_logged(run2, file_path, data_format)
      time.sleep(1)
      assert mlflow.active_run() is None
  
file_path: mlflow/tests/spark/autologging/datasource/test_spark_datasource_autologging_crossframework.py
imports: import time
  import numpy
  import pytest
  from sklearn.linear_model import LinearRegression
  import mlflow
  import mlflow.spark
  from tests.spark.autologging.utils import _assert_spark_data_logged
label_desc: Use image node_id 7 for calling a global function with example usage: test_spark_sklearn_autologging_context_provider(spark_session, data_format, file_path) without return types