MCPcopy Index your code
hub / github.com/pathwaycom/pathway / test_buffer_2

Function test_buffer_2

python/pathway/tests/test_column_properties.py:246–260  ·  view source on GitHub ↗
(append_only_1, append_only_2)

Source from the content-addressed store, hash-verified

244@pytest.mark.parametrize("append_only_1", [True, False])
245@pytest.mark.parametrize("append_only_2", [True, False])
246def test_buffer_2(append_only_1, append_only_2):
247 class Schema(pw.Schema):
248 a: int = pw.column_definition(append_only=append_only_1)
249 b: int = pw.column_definition(append_only=append_only_2)
250
251 table = table_from_datasource(TestDataSource(schema=Schema))
252 result = table._buffer(pw.this.a + 10, pw.this.a)
253
254 assert result._id_column.properties.append_only == append_only_1
255 assert result.a._column.properties.append_only == append_only_1
256 assert result.b._column.properties.append_only == (append_only_1 and append_only_2)
257 # not obvious that it requires append_only_1 but if column `a` isn't append only and
258 # column `b` is, we can have a situation when an old row leaves the buffer immediately
259 # and a new row is kept. Then row is doesn't exist on the output for some time
260 # so column `b` can't be append-only.
261
262
263@pytest.mark.parametrize("append_only", [True, False])

Callers

nothing calls this directly

Calls 3

table_from_datasourceFunction · 0.90
TestDataSourceClass · 0.90
_bufferMethod · 0.80

Tested by

no test coverage detected