code: def test_pickle_roundtrip_pyarrow_string_implementations(
      string_dtype,
  ):
      # There are two pyarrow string implementations in pandas.
      # This tests that both implementations have similar serialization performance.
      if string_dtype == "stringdtype":
          string_dtype = pd.StringDtype("pyarrow")
      else:
          string_dtype = pd.ArrowDtype(pa.string())
      expected = pd.Series(map(str, range(1_000)), dtype=string_dtype)
      expected_sliced = expected.head(2)
      full_pickled = pickle.dumps(expected)
      sliced_pickled = pickle.dumps(expected_sliced)
  
      # Make sure slicing gives a large reduction in serialized bytes
      assert len(full_pickled) > len(sliced_pickled) * 3
  
      result = pickle.loads(full_pickled)
      tm.assert_series_equal(result, expected)
  
      result_sliced = pickle.loads(sliced_pickled)
      tm.assert_series_equal(result_sliced, expected_sliced)
  
file_path: dask/dask/dataframe/tests/test_pyarrow_compat.py
imports: from __future__ import annotations
  import pickle
  from datetime import date, datetime, time, timedelta
  from decimal import Decimal
  import pandas
  import pandas._testing
  import pytest
  from dask.dataframe._compat import PANDAS_GE_150
label_desc: Use image node_id 4 for calling a global function with example usage: test_pickle_roundtrip_pyarrow_string_implementations(string_dtype) without return types