From 17a847b2b72d290f990c4003b641325b5c55e697 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Thu, 3 Sep 2020 09:40:31 -0400 Subject: [PATCH] FEAT-#1222: Add more tests for Series.asof(). Signed-off-by: Itamar Turner-Trauring --- modin/pandas/test/test_series.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/modin/pandas/test/test_series.py b/modin/pandas/test/test_series.py index 95fa93ec505..8659fbfdae4 100644 --- a/modin/pandas/test/test_series.py +++ b/modin/pandas/test/test_series.py @@ -842,7 +842,31 @@ def test_asfreq(): series.asfreq(freq="30S") -def test_asof(): +@pytest.mark.parametrize( + "where", + [ + 20, + 30, + [10, 40], + [20, 30], + [20], + 25, + [25, 45], + [25, 30], + pandas.Index([20, 30]), + pandas.Index([10]), + ], +) +def test_asof(where): + values = [1, 2, np.nan, 4] + index = [10, 20, 30, 40] + modin_series, pandas_series = pd.Series(values, index=index), pandas.Series( + values, index=index + ) + df_equals(modin_series.asof(where), pandas_series.asof(where)) + + +def test_asof_dates(): series = pd.Series( [10, 20, 30, 40, 50], index=pd.DatetimeIndex(