Pandas version checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have confirmed this bug exists on the latest version of pandas.

  • [ ] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

ser = pd.Series([i / 10 for i in range(1, 20)]).astype(pd.Float64Dtype())
ser.rolling(2).mean().dtype # dtype('float64')

Issue Description

#Rolling.mean prematurely downcast from extension-array type dtypes

Expected Behavior

That (in this example) the Float64Dtype is preserved

Installed Versions

INSTALLED VERSIONS ------------------ commit : 8dab54d6573f7186ff0c3b6364d5e4dd635ff3e7 python : 3.10.8.final.0 python-bits : 64 OS : Windows OS-release : 10 Version : 10.0.19044 machine : AMD64 processor : Intel64 Family 6 Model 165 Stepping 3, GenuineIntel byteorder : little LC_ALL : en_US.UTF-8 LANG : en_US.UTF-8 LOCALE : English_United Kingdom.1252 pandas : 1.5.2 numpy : 1.23.4 pytz : 2022.1 dateutil : 2.8.2 setuptools : 65.5.0 pip : 22.2.2 Cython : None pytest : None hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : 4.9.1 html5lib : None pymysql : 1.0.2 psycopg2 : None jinja2 : 3.1.2 IPython : 8.6.0 pandas_datareader: None bs4 : 4.11.1 bottleneck : None brotli : fastparquet : None fsspec : None gcsfs : None matplotlib : 3.5.3 numba : None numexpr : None odfpy : None openpyxl : 3.0.10 pandas_gbq : None pyarrow : 9.0.0 pyreadstat : None pyxlsb : None s3fs : None scipy : None snappy : None sqlalchemy : 1.4.39 tables : None tabulate : None xarray : None xlrd : None xlwt : None zstandard : None tzdata : None

Comment From: phofl

Hi, thanks for your report. This is already known and on our list. Rolling does not support extension arrays yet, hence we have to cast to numpy dtypes

Comment From: bollard

Ah understood, thanks. Is there anywhere I can track this?

Comment From: phofl

Not sure, if we have an appropriate issue about this. If not, a tracker issue like ENH: Add masked support for rolling operations would be welcome

Comment From: bollard

Done https://github.com/pandas-dev/pandas/issues/50449. Thanks!

Comment From: phofl

Thx, this is more helpful than a couple of different issues where every one of them lists a different method