code: def test_cum():
      # create new column (cumsum)
      post_df = pp.cum(
          df=timeseries_df,
          columns={"y": "y2"},
          operator="sum",
      )
      assert post_df.columns.tolist() == ["label", "y", "y2"]
      assert series_to_list(post_df["label"]) == ["x", "y", "z", "q"]
      assert series_to_list(post_df["y"]) == [1.0, 2.0, 3.0, 4.0]
      assert series_to_list(post_df["y2"]) == [1.0, 3.0, 6.0, 10.0]
  
      # overwrite column (cumprod)
      post_df = pp.cum(
          df=timeseries_df,
          columns={"y": "y"},
          operator="prod",
      )
      assert post_df.columns.tolist() == ["label", "y"]
      assert series_to_list(post_df["y"]) == [1.0, 2.0, 6.0, 24.0]
  
      # overwrite column (cummin)
      post_df = pp.cum(
          df=timeseries_df,
          columns={"y": "y"},
          operator="min",
      )
      assert post_df.columns.tolist() == ["label", "y"]
      assert series_to_list(post_df["y"]) == [1.0, 1.0, 1.0, 1.0]
  
      # invalid operator
      with pytest.raises(InvalidPostProcessingError):
          pp.cum(
              df=timeseries_df,
              columns={"y": "y"},
              operator="abc",
          )
  
file_path: superset/tests/unit_tests/pandas_postprocessing/test_cum.py
imports: import pandas
  import pytest
  from superset.exceptions import InvalidPostProcessingError
  from superset.utils import pandas_postprocessing
  from superset.utils.pandas_postprocessing.utils import FLAT_COLUMN_SEPARATOR
  from tests.unit_tests.fixtures.dataframes import multiple_metrics_df, single_metric_df, timeseries_df, timeseries_with_gap_df
  from tests.unit_tests.pandas_postprocessing.utils import series_to_list
label_desc: Use image node_id 2 for calling a global function with example usage: test_cum() without return types