(append_only_1, append_only_2)
| 244 | @pytest.mark.parametrize("append_only_1", [True, False]) |
| 245 | @pytest.mark.parametrize("append_only_2", [True, False]) |
| 246 | def 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]) |
nothing calls this directly
no test coverage detected