Skip to content

Commit

Permalink
FEAT-modin-project#1222: Add more tests for Series.asof().
Browse files Browse the repository at this point in the history
Signed-off-by: Itamar Turner-Trauring <itamar@itamarst.org>
  • Loading branch information
itamarst committed Sep 3, 2020
1 parent 604398b commit 17a847b
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion modin/pandas/test/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 17a847b

Please sign in to comment.