code: def test_df_groupby_agg():
      df = DataFrame({"foo": (1, 1, 3), "bar": (4, 5, 6)})
  
      a = df.groupby(by="foo", as_index=False).sum()
      required_columns = SelfColumnSelector.select(a.data)
      assert required_columns == {"foo"}
  
      a = df.groupby(by="foo").sum()
      required_columns = SelfColumnSelector.select(a.data)
      assert required_columns == set()
  
imports: from ......dataframe import DataFrame
  from ..self_column_selector import SelfColumnSelector
label_desc: Use image node_id 3 for calling a global function with example usage: test_df_groupby_agg() without return types