code: def test_conversion_to_json_spark_dataset_source(
      spark_session, tmp_path, df
  ):
      df_spark = spark_session.createDataFrame(df)
      path = str(tmp_path / "temp.parquet")
      df_spark.write.parquet(path)
  
      source = SparkDatasetSource(path=path)
  
      dataset = SparkDataset(
          df=df_spark,
          source=source,
          name="testname",
      )
  
      dataset_json = dataset.to_json()
      parsed_json = json.loads(dataset_json)
      assert parsed_json.keys() <= {
          "name",
          "digest",
          "source",
          "source_type",
          "schema",
          "profile",
      }
      assert parsed_json["name"] == dataset.name
      assert parsed_json["digest"] == dataset.digest
      assert parsed_json["source"] == dataset.source.to_json()
      assert (
          parsed_json["source_type"]
          == dataset.source._get_source_type()
      )
      assert parsed_json["profile"] == json.dumps(dataset.profile)
  
      schema_json = json.dumps(
          json.loads(parsed_json["schema"])["mlflow_colspec"]
      )
      assert Schema.from_json(schema_json) == dataset.schema
  
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 5 for calling a global function with example usage: test_conversion_to_json_spark_dataset_source(spark_session, tmp_path, df) without return types