We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fda93c commit 378a3d8Copy full SHA for 378a3d8
1 file changed
streamz/tests/test_batch.py
@@ -37,6 +37,21 @@ def test_dataframes():
37
assert result.z.tolist() == [3 * i for i in range(10)]
38
39
40
+def test_periodic_dataframes():
41
+ pd = pytest.importorskip('pandas')
42
+ from streamz.dataframe import PeriodicDataFrame
43
+ from streamz.dataframe.core import random_datapoint
44
+ df = random_datapoint()
45
+ assert len(df)==1
46
+
47
+ def callback(**kwargs):
48
+ return pd.DataFrame(dict(x=50, index=[pd.Timestamp.now()]))
49
50
+ df = PeriodicDataFrame(callback, interval='20ms')
51
+ assert df.tail(0).x==50
52
+ df.stop()
53
54
55
def test_filter():
56
a = Batch()
57
f = a.filter(lambda x: x % 2 == 0)
0 commit comments