code: def test_groupby_apply_with_arrow_dtype(setup):
      df1 = pd.DataFrame({"a": [1, 2, 1], "b": ["a", "b", "a"]})
      mdf = md.DataFrame(df1)
      mdf["b"] = mdf["b"].astype("Arrow[string]")
  
      applied = mdf.groupby("b").apply(lambda df: df.a.sum())
      result = applied.execute().fetch()
      result.index = result.index.astype(object)
      expected = df1.groupby("b").apply(lambda df: df.a.sum())
      pd.testing.assert_series_equal(result, expected)
  
      series1 = df1["b"]
      mseries = md.Series(series1).astype("Arrow[string]")
  
      applied = mseries.groupby(mseries).apply(lambda s: s)
      result = applied.execute().fetch()
      result.index = result.index.astype(np.int64)
      expected = series1.groupby(series1).apply(lambda s: s)
      pd.testing.assert_series_equal(
          arrow_array_to_objects(result), expected
      )
  
imports: from collections import OrderedDict
  import numpy
  import pandas
  import pytest
  from ....None import dataframe
  from ....config import option_context
  from ....core.operand import OperandStage
  from ....tests.core import assert_groupby_equal, require_cudf
  from ....utils import arrow_array_to_objects, pd_release_version
  from ...core import DATAFRAME_OR_SERIES_TYPE
  from ..aggregation import DataFrameGroupByAgg
label_desc: Use image node_id 19 for calling a global function with example usage: test_groupby_apply_with_arrow_dtype(setup) without return types