code: def test_roundtrip_parquet_spark_to_dask(
      spark_session, npartitions, tmpdir, engine
  ):
      tmpdir = str(tmpdir)
  
      sdf = spark_session.createDataFrame(pdf)
      # We are not overwriting any data, but spark complains if the directory
      # already exists (as tmpdir does) and we don't set overwrite
      sdf.repartition(npartitions).write.parquet(
          tmpdir, mode="overwrite"
      )
  
      ddf = dd.read_parquet(tmpdir, engine=engine)
      # Papercut: pandas TZ localization doesn't survive roundtrip
      ddf = ddf.assign(timestamp=ddf.timestamp.dt.tz_localize("UTC"))
      assert ddf.npartitions == npartitions
  
      assert_eq(ddf, pdf, check_index=False)
  
file_path: dask/dask/tests/test_spark_compat.py
imports: from __future__ import annotations
  import decimal
  import signal
  import sys
  import threading
  import pytest
  from dask.datasets import timeseries
  import numpy
  import pandas
  from dask.dataframe._compat import PANDAS_GE_150, PANDAS_GE_200
  from dask.dataframe.utils import assert_eq
label_desc: Use image node_id 3 for calling a global function with example usage: test_roundtrip_parquet_spark_to_dask(spark_session, npartitions, tmpdir, engine) without return types