code: def test_conversion_to_json():
      source_uri = "test:/my/test/uri"
      source = TestDatasetSource._resolve(source_uri)
      dataset = NumpyDataset(
          features=np.array([1, 2, 3]), 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)
  
      parsed_schema = json.loads(parsed_json["schema"])
      assert (
          TensorDatasetSchema.from_dict(parsed_schema) == dataset.schema
      )
  
imports: import json
  import numpy
  import pandas
  import pytest
  import mlflow.data
  from mlflow.data.code_dataset_source import CodeDatasetSource
  from mlflow.data.filesystem_dataset_source import FileSystemDatasetSource
  from mlflow.data.numpy_dataset import NumpyDataset
  from mlflow.data.pyfunc_dataset_mixin import PyFuncInputsOutputs
  from mlflow.data.schema import TensorDatasetSchema
  from mlflow.models.evaluation.base import EvaluationDataset
  from mlflow.types.utils import _infer_schema
  from tests.resources.data.dataset_source import TestDatasetSource
label_desc: Use image node_id 1 for calling a global function with example usage: test_conversion_to_json() without return types