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

Function test_restrict

python/pathway/tests/test_persistence.py:359–376  ·  view source on GitHub ↗
(tmp_path, mode)

Source from the content-addressed store, hash-verified

357)
358@only_with_license_key("mode", [api.PersistenceMode.OPERATOR_PERSISTING])
359def 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(

Callers

nothing calls this directly

Calls 3

runFunction · 0.90
get_two_tables_runnerFunction · 0.85
removeMethod · 0.45

Tested by

no test coverage detected