code: def test_write_parquet_using_pyarrow_write_to_dataset_with_partitioning(
      tmp_path: Path,
      compression: ParquetCompression,
  ) -> None:
      df = pl.DataFrame(
          {"a": [1, 2, 3], "partition_col": ["one", "two", "two"]}
      )
      path_to_write = tmp_path / "test_folder"
      path_to_write.mkdir(exist_ok=True)
      df.write_parquet(
          file=path_to_write,
          statistics=True,
          use_pyarrow=True,
          row_group_size=128,
          pyarrow_options={
              "partition_cols": ["partition_col"],
              "compression": compression,
          },
      )
  
      # cast is necessary as pyarrow writes partitions as categorical type
      read_df = pl.read_parquet(
          path_to_write, use_pyarrow=True
      ).with_columns(pl.col("partition_col").cast(pl.String))
      assert_frame_equal(df, read_df)
  
imports: from __future__ import annotations
  import io
  from datetime import datetime, time, timezone
  from decimal import Decimal
  from typing import TYPE_CHECKING
  import numpy
  import pandas
  import pyarrow
  import pyarrow.dataset
  import pyarrow.parquet
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_write_parquet_using_pyarrow_write_to_dataset_with_partitioning(tmp_path, compression) without return types