code: def test_to_pandas(ray_start_regular_shared):
      n = 5
      df = pd.DataFrame({"id": list(range(n))})
      ds = ray.data.range(n)
      dfds = ds.to_pandas()
      assert df.equals(dfds)
  
      # Test limit.
      with pytest.raises(ValueError):
          dfds = ds.to_pandas(limit=3)
  
      # Test limit greater than number of rows.
      dfds = ds.to_pandas(limit=6)
      assert df.equals(dfds)
  
file_path: ray/python/ray/data/tests/test_pandas.py
imports: import numpy
  import pandas
  import pyarrow
  import pytest
  import ray
  from ray.data.extensions import ArrowTensorArray, ArrowTensorType, TensorDtype
  from ray.data.tests.conftest import *
  from ray.data.tests.mock_http_server import *
  from ray.tests.conftest import *
label_desc: Use image node_id 3 for calling a global function with example usage: test_to_pandas(ray_start_regular_shared) without return types