code: def test_load_csv_dataset(tmpdir):
      input_df = pd.DataFrame(
          {
              "name": ["Raphael", "Donatello"],
              "mask": ["red", "purple"],
              "weapon": ["sai", "bo staff"],
              "split": [0, 1],
          }
      )
  
      extracted_filename = "input.csv"
      compression_opts = dict(
          method="zip", archive_name=extracted_filename
      )
  
      archive_filename = os.path.join(tmpdir, "archive.zip")
      input_df.to_csv(
          archive_filename, index=False, compression=compression_opts
      )
  
      config = DatasetConfig(
          version=1.0,
          name="fake_csv_dataset",
          download_urls=["file://" + archive_filename],
      )
  
      ludwig.datasets._get_dataset_configs.cache_clear()
      with mock.patch(
          "ludwig.datasets._load_dataset_config", return_value=config
      ):
          dataset = ludwig.datasets.get_dataset(
              "fake_csv_dataset", cache_dir=tmpdir
          )
  
          assert not dataset.state == DatasetState.DOWNLOADED
          assert not dataset.state == DatasetState.TRANSFORMED
  
          output_df = dataset.load()
          pd.testing.assert_frame_equal(input_df, output_df)
  
          assert dataset.state == DatasetState.TRANSFORMED
      ludwig.datasets._get_dataset_configs.cache_clear()
  
file_path: ludwig/tests/ludwig/datasets/test_datasets.py
imports: import io
  import os
  import uuid
  from unittest import mock
  import pandas
  import pytest
  import ludwig.datasets
  from ludwig.api import LudwigModel
  from ludwig.datasets.dataset_config import DatasetConfig
  from ludwig.datasets.loaders.dataset_loader import DatasetState
  from tests.integration_tests.utils import private_test
label_desc: Use image node_id 1 for calling a global function with example usage: test_load_csv_dataset(tmpdir) without return types