MCPcopy
hub / github.com/pathwaycom/pathway / test_forget_instance

Function test_forget_instance

python/pathway/tests/temporal/test_operators.py:9–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8
9def test_forget_instance():
10 t = pw.debug.table_from_markdown(
11 """
12 a | t | __time__
13 1 | 2 | 2
14 1 | 3 | 2
15 1 | 5 | 4
16 1 | 15 | 8
17 1 | 7 | 10
18 2 | 4 | 2
19 2 | 8 | 4
20 2 | 9 | 8
21 3 | 1 | 6
22 """
23 )
24
25 res = t._forget(
26 pw.this.t + 2,
27 pw.this.t,
28 mark_forgetting_records=False,
29 instance_column=pw.this.a,
30 )
31 expected = pw.debug.table_from_markdown(
32 """
33 a | t | __time__ | __diff__
34 1 | 2 | 2 | 1
35 1 | 3 | 2 | 1
36 1 | 5 | 4 | 1
37 1 | 2 | 6 | -1
38 1 | 3 | 6 | -1
39 1 | 15 | 8 | 1
40 1 | 5 | 10 | -1
41 2 | 4 | 2 | 1
42 2 | 8 | 4 | 1
43 2 | 4 | 6 | -1
44 2 | 9 | 8 | 1
45 3 | 1 | 6 | 1
46 """
47 )
48 assert_stream_equality_wo_index(res, expected)
49
50
51@pytest.mark.parametrize("public", [True, False])

Callers

nothing calls this directly

Calls 2

table_from_markdownMethod · 0.80
_forgetMethod · 0.80

Tested by

no test coverage detected