code: def test_spark_dataset_source_from_table(spark_session, tmp_path):
      df = pd.DataFrame([[1, 2, 3], [1, 2, 3]], columns=["a", "b", "c"])
      df_spark = spark_session.createDataFrame(df)
      df_spark.write.mode("overwrite").saveAsTable(
          "temp", path=tmp_path
      )
  
      spark_datasource = SparkDatasetSource(table_name="temp")
      assert spark_datasource.to_json() == json.dumps(
          {"table_name": "temp"}
      )
      loaded_df_spark = spark_datasource.load()
      assert loaded_df_spark.count() == df_spark.count()
  
      reloaded_source = get_dataset_source_from_json(
          spark_datasource.to_json(),
          source_type=spark_datasource._get_source_type(),
      )
      assert isinstance(reloaded_source, SparkDatasetSource)
      assert type(spark_datasource) == type(reloaded_source)
      assert reloaded_source.to_json() == spark_datasource.to_json()
  
file_path: mlflow/tests/data/test_spark_dataset_source.py
imports: import json
  import pandas
  import pytest
  from mlflow.data.dataset_source_registry import get_dataset_source_from_json
  from mlflow.data.spark_dataset_source import SparkDatasetSource
  from mlflow.exceptions import MlflowException
label_desc: Use image node_id 3 for calling a global function with example usage: test_spark_dataset_source_from_table(spark_session, tmp_path) without return types