code: def test_groupby_nunique_series(setup, gen_data1):
      df = gen_data1
      mdf = md.DataFrame(df, chunk_size=13)
      # When method = shuffle and output is series, mars has issue about that.
      # Therefore, skip the case.
      r1 = (
          mdf.groupby("b", sort=False)["a"]
          .nunique(method="tree")
          .execute()
          .fetch()
      )
      r2 = (
          mdf.groupby("b", sort=False)["a"]
          .nunique(method="auto")
          .execute()
          .fetch()
          .sort_index(level=0)
      )
  
      expected = df.groupby("b", sort=False)["a"].nunique()
      pd.testing.assert_series_equal(r1, expected)
      pd.testing.assert_series_equal(r2, expected.sort_index(level=0))
  
file_path: mars/mars/dataframe/groupby/tests/test_groupby_nunique_execution.py
imports: import numpy
  import pandas
  import pytest
  from ....None import dataframe
label_desc: Use image node_id 6 for calling a global function with example usage: test_groupby_nunique_series(setup, gen_data1) without return types