Skip to content

Commit b77d76e

Browse files
committed
Relax tolerance in autocorr test
pandas-dev/pandas#61154 changed the behavior of pandas' correleation methods for series whose `r` is close to -1 or 1. This updates our test to adapt to that change by increasing the tolerance we consider equal.
1 parent cebcc04 commit b77d76e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dask/dataframe/dask_expr/tests/test_reductions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def test_cov_corr(df, pdf):
353353

354354
assert_eq(df.x.cov(df.y), pdf.x.cov(pdf.y))
355355
assert_eq(df.x.corr(df.y), pdf.x.corr(pdf.y))
356-
assert_eq(df.x.autocorr(lag=1), pdf.x.autocorr(lag=1))
356+
assert_eq(df.x.autocorr(lag=1), pdf.x.autocorr(lag=1), atol=1e-3)
357357

358358

359359
def test_reduction_on_empty_df():

dask/dataframe/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ def assert_eq(
578578
if np.isnan(a):
579579
assert np.isnan(b)
580580
else:
581-
assert np.allclose(a, b)
581+
assert np.allclose(a, b, **kwargs)
582582
return True
583583

584584

0 commit comments

Comments
 (0)