code: def test_from_spark_path(spark_session, tmp_path, df):
      df_spark = spark_session.createDataFrame(df)
      dir_path = str(tmp_path / "df_dir")
      df_spark.write.parquet(dir_path)
      assert os.path.isdir(dir_path)
  
      mlflow_df_from_dir = mlflow.data.from_spark(
          df_spark, path=dir_path
      )
      _check_spark_dataset(
          mlflow_df_from_dir, df, df_spark, SparkDatasetSource
      )
  
      file_path = str(tmp_path / "df.parquet")
      df_spark.toPandas().to_parquet(file_path)
      assert not os.path.isdir(file_path)
  
      mlflow_df_from_file = mlflow.data.from_spark(
          df_spark, path=file_path
      )
      _check_spark_dataset(
          mlflow_df_from_file, df, df_spark, SparkDatasetSource
      )
  
imports: import json
  import os
  import pandas
  import pytest
  import mlflow.data
  from mlflow.data.code_dataset_source import CodeDatasetSource
  from mlflow.data.delta_dataset_source import DeltaDatasetSource
  from mlflow.data.spark_dataset import SparkDataset
  from mlflow.data.spark_dataset_source import SparkDatasetSource
  from mlflow.exceptions import MlflowException
  from mlflow.models.evaluation.base import EvaluationDataset
  from mlflow.types.schema import Schema
  from mlflow.types.utils import _infer_schema
label_desc: Use image node_id 12 for calling a global function with example usage: test_from_spark_path(spark_session, tmp_path, df) without return types