Skip to content

Commit 9fdf80c

Browse files
committed
added pytest.fixture & whatsnew
1 parent f21d4d3 commit 9fdf80c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/source/whatsnew/v1.4.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Groupby/resample/rolling
258258
^^^^^^^^^^^^^^^^^^^^^^^^
259259
- Fixed bug in :meth:`SeriesGroupBy.apply` where passing an unrecognized string argument failed to raise ``TypeError`` when the underlying ``Series`` is empty (:issue:`42021`)
260260
- Bug in :meth:`Series.rolling.apply`, :meth:`DataFrame.rolling.apply`, :meth:`Series.expanding.apply` and :meth:`DataFrame.expanding.apply` with ``engine="numba"`` where ``*args`` were being cached with the user passed function (:issue:`42287`)
261-
-
261+
- Bug in :meth:`pandas.DataFrame.ewm`, where non-float64 dtypes were silently failing (:issue:`42452`)
262262

263263
Reshaping
264264
^^^^^^^^^

pandas/tests/window/test_ewm.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ def test_ewma_times_adjust_false_raises():
184184

185185

186186
@pytest.mark.parametrize("func", ["mean", "std", "var"])
187-
@pytest.mark.parametrize("dtype", [np.float32, np.float16, np.float64, float, "float"])
188-
def test_float_dtype_ewma(dtype, func):
187+
def test_float_dtype_ewma(func, float_dtype):
189188
# GH#42452
190189
expected_mean = DataFrame(
191190
{
@@ -203,7 +202,9 @@ def test_float_dtype_ewma(dtype, func):
203202
}
204203
)
205204
expected_var = expected_std ** 2
206-
df = DataFrame({0: range(5), 1: range(6, 11), 2: range(10, 20, 2)}, dtype=dtype)
205+
df = DataFrame(
206+
{0: range(5), 1: range(6, 11), 2: range(10, 20, 2)}, dtype=float_dtype
207+
)
207208
e = df.ewm(alpha=0.5, axis=1)
208209
result = getattr(e, func)()
209210
expected = {

0 commit comments

Comments
 (0)