code: def test_autologging_of_datasources_with_different_formats(
      spark_session, format_to_file_path
  ):
      mlflow.spark.autolog()
      for data_format, file_path in format_to_file_path.items():
          base_df = (
              spark_session.read.format(data_format)
              .option("header", "true")
              .option("inferSchema", "true")
              .load(file_path)
          )
          base_df.createOrReplaceTempView("temptable")
          table_df0 = spark_session.table("temptable")
          table_df1 = spark_session.sql(
              "SELECT number1, number2 from temptable LIMIT 5"
          )
          dfs = [
              base_df,
              table_df0,
              table_df1,
              base_df.filter("number1 > 0"),
              base_df.select("number1"),
              base_df.limit(2),
              base_df.filter("number1 > 0").select("number1").limit(2),
          ]
  
          for df in dfs:
              with mlflow.start_run():
                  run_id = mlflow.active_run().info.run_id
                  df.collect()
                  time.sleep(1)
  
              run = mlflow.get_run(run_id)
              _assert_spark_data_logged(
                  run=run, path=file_path, data_format=data_format
              )
  
file_path: mlflow/tests/spark/autologging/datasource/test_spark_datasource_autologging.py
imports: import time
  from unittest import mock
  from pyspark.sql import Row
  from pyspark.sql.types import IntegerType, StructField, StructType
  import mlflow
  import mlflow.spark
  from mlflow._spark_autologging import _SPARK_TABLE_INFO_TAG_NAME
  from mlflow.utils.validation import MAX_TAG_VAL_LENGTH
  from tests.spark.autologging.utils import _assert_spark_data_logged
  from tests.tracking.integration_test_utils import _init_server
label_desc: Use image node_id 2 for calling a global function with example usage: test_autologging_of_datasources_with_different_formats(spark_session, format_to_file_path) without return types