code: def test_roundtrip_parquet_spark_to_dask_extension_dtypes(
      spark_session, tmpdir
  ):
      tmpdir = str(tmpdir)
      npartitions = 5
  
      size = 20
      pdf = pd.DataFrame(
          {
              "a": range(size),
              "b": np.random.random(size=size),
              "c": [True, False] * (size // 2),
              "d": ["alice", "bob"] * (size // 2),
          }
      )
      # Note: since we set dtype_backend="numpy_nullable" below, we are expecting *all*
      # of the resulting series to use those dtypes. If there is a mix of nullable
      # and non-nullable dtypes here, then that will result in dtype mismatches
      # in the finale frame.
      pdf = pdf.astype(
          {
              "a": "Int64",
              "b": "Float64",
              "c": "boolean",
              "d": "string",
          }
      )
      # # Ensure all columns are extension dtypes
      assert all(
          [
              pd.api.types.is_extension_array_dtype(dtype)
              for dtype in pdf.dtypes
          ]
      )
  
      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="pyarrow", dtype_backend="numpy_nullable"
      )
      assert all(
          [
              pd.api.types.is_extension_array_dtype(dtype)
              for dtype in ddf.dtypes
          ]
      ), ddf.dtypes
      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 6 for calling a global function with example usage: test_roundtrip_parquet_spark_to_dask_extension_dtypes(spark_session, tmpdir) without return types