(tmp_path, mode)
| 357 | ) |
| 358 | @only_with_license_key("mode", [api.PersistenceMode.OPERATOR_PERSISTING]) |
| 359 | def test_restrict(tmp_path, mode): |
| 360 | class InputSchema(pw.Schema): |
| 361 | a: int = pw.column_definition(primary_key=True) |
| 362 | |
| 363 | def logic(t_1: pw.Table, t_2: pw.Table) -> pw.Table: |
| 364 | t_2.promise_universe_is_subset_of(t_1) |
| 365 | return t_1.restrict(t_2) |
| 366 | |
| 367 | run, _, input_path_2 = get_two_tables_runner( |
| 368 | tmp_path, mode, logic, InputSchema, terminate_on_error=False |
| 369 | ) |
| 370 | |
| 371 | run(["a", "1", "2", "3"], ["a", "1"], {"1,1"}) |
| 372 | run(["a"], ["a", "3"], {"3,1"}) |
| 373 | run(["a", "4", "5"], ["a", "5"], {"5,1"}) |
| 374 | run(["a", "6"], ["a", "4", "6"], {"4,1", "6,1"}) |
| 375 | os.remove(input_path_2 / "3") |
| 376 | run(["a"], ["a"], {"5,-1"}) |
| 377 | |
| 378 | |
| 379 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected