code: def test_to_from_buffer(
      df: pl.DataFrame,
      compression: ParquetCompression,
      use_pyarrow: bool,
  ) -> None:
      print(df)
      df = df[["list_str"]]
      print(df)
      buf = io.BytesIO()
      df.write_parquet(
          buf, compression=compression, use_pyarrow=use_pyarrow
      )
      buf.seek(0)
      read_df = pl.read_parquet(buf, use_pyarrow=use_pyarrow)
      print(read_df)
      assert_frame_equal(df, read_df, categorical_as_str=True)
  
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 4 for calling a global function with example usage: test_to_from_buffer(df, compression, use_pyarrow) without return types