code: def test_deprecated_use_legacy_dataset(tempdir):
      # Test that specifying use_legacy_dataset in ParquetDataset, write_to_dataset
      # and read_table doesn't raise an error but gives a warning.
      table = pa.table({"a": [1, 2, 3]})
      path = tempdir / "deprecate_legacy"
  
      msg = "Passing 'use_legacy_dataset'"
      with pytest.warns(FutureWarning, match=msg):
          pq.write_to_dataset(table, path, use_legacy_dataset=False)
  
      pq.write_to_dataset(table, path)
  
      with pytest.warns(FutureWarning, match=msg):
          pq.read_table(path, use_legacy_dataset=False)
  
      with pytest.warns(FutureWarning, match=msg):
          pq.ParquetDataset(path, use_legacy_dataset=False)
  
imports: from collections import OrderedDict
  import io
  import warnings
  from shutil import copytree
  import numpy
  import pytest
  import pyarrow
  from pyarrow import fs
  from pyarrow.filesystem import LocalFileSystem, FileSystem
  from pyarrow.tests import util
  from pyarrow.tests.parquet.common import _check_roundtrip, _roundtrip_table, _test_dataframe
label_desc: Use image node_id 40 for calling a global function with example usage: test_deprecated_use_legacy_dataset(tempdir) without return types