code: def test_dataframe_reduction(
      setup, check_ref_counts, func_name, func_opts: FunctionOptions
  ):
      def compute(data, **kwargs):
          return getattr(data, func_name)(**kwargs)
  
      rs = np.random.RandomState(0)
      data = pd.DataFrame(rs.rand(20, 10))
      r = compute(md.DataFrame(data))
      pd.testing.assert_series_equal(compute(data), r.execute().fetch())
  
      r = compute(md.DataFrame(data, chunk_size=3))
      pd.testing.assert_series_equal(compute(data), r.execute().fetch())
  
      r = compute(
          md.DataFrame(data, chunk_size=6),
          axis="index",
          numeric_only=True,
      )
      pd.testing.assert_series_equal(
          compute(data, axis="index", numeric_only=True),
          r.execute().fetch(),
      )
  
      r = compute(md.DataFrame(data, chunk_size=3), axis=1)
      pd.testing.assert_series_equal(
          compute(data, axis=1), r.execute().fetch()
      )
  
      # test null
      np_data = rs.rand(20, 10)
      np_data[np_data > 0.6] = np.nan
      data = pd.DataFrame(np_data)
  
      r = compute(md.DataFrame(data, chunk_size=3))
      pd.testing.assert_series_equal(compute(data), r.execute().fetch())
  
      r = compute(md.DataFrame(data, chunk_size=3), skipna=False)
      pd.testing.assert_series_equal(
          compute(data, skipna=False), r.execute().fetch()
      )
  
      r = compute(md.DataFrame(data, chunk_size=3), skipna=False)
      pd.testing.assert_series_equal(
          compute(data, skipna=False), r.execute().fetch()
      )
  
      if func_opts.has_min_count:
          r = compute(md.DataFrame(data, chunk_size=3), min_count=15)
          pd.testing.assert_series_equal(
              compute(data, min_count=15), r.execute().fetch()
          )
  
          r = compute(md.DataFrame(data, chunk_size=3), min_count=3)
          pd.testing.assert_series_equal(
              compute(data, min_count=3), r.execute().fetch()
          )
  
          r = compute(
              md.DataFrame(data, chunk_size=3), axis=1, min_count=3
          )
          pd.testing.assert_series_equal(
              compute(data, axis=1, min_count=3), r.execute().fetch()
          )
  
          r = compute(
              md.DataFrame(data, chunk_size=3), axis=1, min_count=8
          )
          pd.testing.assert_series_equal(
              compute(data, axis=1, min_count=8), r.execute().fetch()
          )
  
      # test numeric_only
      data = pd.DataFrame(
          rs.rand(10, 10),
          index=rs.randint(-100, 100, size=(10,)),
          columns=[rs.bytes(10) for _ in range(10)],
      )
      r = compute(md.DataFrame(data, chunk_size=2))
      pd.testing.assert_series_equal(compute(data), r.execute().fetch())
  
      r = compute(
          md.DataFrame(data, chunk_size=6),
          axis="index",
          numeric_only=True,
      )
      pd.testing.assert_series_equal(
          compute(data, axis="index", numeric_only=True),
          r.execute().fetch(),
      )
  
      r = compute(md.DataFrame(data, chunk_size=3), axis="columns")
      pd.testing.assert_series_equal(
          compute(data, axis="columns"), r.execute().fetch()
      )
  
      data_dict = dict((str(i), rs.rand(10)) for i in range(10))
      data_dict["string"] = pd.Series([str(i) for i in range(10)]).radd(
          "O"
      )
      data_dict["bool"] = rs.choice([True, False], (10,))
      data = pd.DataFrame(data_dict)
      r = compute(
          md.DataFrame(data, chunk_size=3),
          axis="index",
          numeric_only=True,
      )
      pd.testing.assert_series_equal(
          compute(data, axis="index", numeric_only=True),
          r.execute().fetch(),
      )
      r = compute(md.DataFrame(data), axis="index", numeric_only=True)
      pd.testing.assert_series_equal(
          compute(data, axis="index", numeric_only=True),
          r.execute().fetch(),
      )
  
      data1 = pd.DataFrame(
          rs.rand(10, 10), columns=[str(i) for i in range(10)]
      )
      data2 = pd.DataFrame(
          rs.rand(10, 10), columns=[str(i) for i in range(10)]
      )
      df = md.DataFrame(data1, chunk_size=5) + md.DataFrame(
          data2, chunk_size=6
      )
      r = compute(df)
      pd.testing.assert_series_equal(
          compute(data1 + data2).sort_index(),
          r.execute().fetch().sort_index(),
      )
  
imports: from typing import NamedTuple
  import numpy
  import pytest
  import pandas
  from ....None import dataframe
  from ....config import option_context
  from ....session import get_default_session
  from ....tests.core import require_cudf, require_cupy
  from ....utils import lazy_import, pd_release_version
  from ...None import CustomReduction, NamedAgg
  from ...base import to_gpu
label_desc: Use image node_id 4 for calling a global function with example usage: test_dataframe_reduction(setup, check_ref_counts, func_name, func_opts) and returns: getattr