DEPR: Rolling.win_type returning freq & is_datetimelike
State: closed

- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

xref: https://github.com/pandas-dev/pandas/pull/38641#issuecomment-754118989
xref: https://github.com/pandas-dev/pandas/pull/38664/files#r551419130

Labels:
name: Deprecate
description: Functionality to remove in pandas
name: Window
description: rolling, ewma, expanding

Comments:
Yes `win_type="freq"` was an internally managed flag that we don't need anymore.

Also since we document in https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rolling.html

> If win_type=None, all points are evenly weighted; otherwise, win_type can accept a string of any scipy.signal window function.

I think its better for consistency that `self.win_type` is only a valid scipy.signal window function
OK, that makes sense.

Another change that I noticed is the value stored in `Rolling.window`:

```
In [5]: freq_roll = Series(range(2), index=date_range("2020", periods=2)).rolling("2s")

In [6]: pd.__version__
Out[6]: '1.2.0'

In [7]: freq_roll.win_type
Out[7]: 'freq'

In [8]: freq_roll.window
Out[8]: 2000000000

In [9]: freq_roll.win_freq
Out[9]: '2s'
```

vs master:

```
In [1]: freq_roll = Series(range(2), index=date_range("2020", periods=2)).rolling("2s")

In [2]: freq_roll.win_type

In [3]: freq_roll.window
Out[3]: '2s'
```

So `Rolling.window` changed from an int (nanoseconds I suppose?) to the freq string. A change that makes sense I think (because the nanoseconds are not really useful, you need it as a Timedelta / actual window or so anyway). 

But, that also makes it hard to follow the suggestion of "Check the type of self.window instead." in the deprecation warning (since this changed as well, or at least that means you need an actual pandas version check to do something different based on the pandas version, so not insurmountable in the end ;))

The doc build is failing, we seem to be checking the `win_type` when its "freq", so might need to catch the warning there (didn't check how it is triggered):

```
>>>-------------------------------------------------------------------------
Warning in /home/runner/work/pandas/pandas/doc/source/user_guide/window.rst at block ending on line 215
Specify :okwarning: as an option in the ipython:: block to suppress this message
----------------------------------------------------------------------------
/home/runner/work/pandas/pandas/pandas/core/groupby/base.py:30: FutureWarning: win_type will no longer return 'freq' in a future version. Check the type of self.window instead.
  kwargs[attr] = getattr(self, attr)
<<<-------------------------------------------------------------------------
```
Yeah the warning is occurring when a `_shallow_copy` is called with a time-based window because `win_type` is an attribute that needs be copied.

Should I just be suppressing that warning in `_shallow_copy`?
Yeah, either catching/suppressing the warning, or either explicitly checking for the "win_type" attribute and in that case check the window and not include win_type if window is a time-based string? (if that's possible) Either is fine for me.

BTW, tested this branch with dask, and the tests are passing again (with warnings). And should be quite straightforward to update it to work on pandas master without warning as well.
thanks @mroeschke 
Thanks @mroeschke !