code: def test_groupby_rolling_object_doesnt_affect_groupby_apply(
      self, roll_frame
  ):
      # GH 39732
      g = roll_frame.groupby("A", group_keys=False)
      msg = "DataFrameGroupBy.apply operated on the grouping columns"
      with tm.assert_produces_warning(FutureWarning, match=msg):
          expected = g.apply(lambda x: x.rolling(4).sum()).index
      _ = g.rolling(window=4)
      msg = "DataFrameGroupBy.apply operated on the grouping columns"
      with tm.assert_produces_warning(FutureWarning, match=msg):
          result = g.apply(lambda x: x.rolling(4).sum()).index
      tm.assert_index_equal(result, expected)
  
imports: import numpy
  import pytest
  from pandas import DataFrame, DatetimeIndex, Index, MultiIndex, Series, Timestamp, date_range, to_datetime
  import pandas._testing
  from pandas.api.indexers import BaseIndexer
  from pandas.core.groupby.groupby import get_groupby
label_desc: Use image node_id 33 for calling the TestRolling obj's underlying member method code with example usage: obj.test_groupby_rolling_object_doesnt_affect_groupby_apply(roll_frame) without return types