MCPcopy Create free account
hub / github.com/pathwaycom/pathway / test_join

Function test_join

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

Source from the content-addressed store, hash-verified

522)
523@only_with_license_key("mode", [api.PersistenceMode.OPERATOR_PERSISTING])
524def test_join(tmp_path, mode):
525 class InputSchema(pw.Schema):
526 a: int = pw.column_definition(primary_key=True)
527 b: int
528
529 def logic(t_1: pw.Table, t_2: pw.Table) -> pw.Table:
530 return t_1.join(t_2, t_1.a == t_2.a).select(
531 pw.this.a, b=pw.left.b, c=pw.right.b
532 )
533
534 run, _, input_path_2 = get_two_tables_runner(tmp_path, mode, logic, InputSchema)
535
536 run(["a,b", "1,2", "2,4"], ["a,b", "1,3"], {"1,2,3,1"})
537 run(["a,b", "3,3"], ["a,b", "2,6", "1,4"], {"2,4,6,1", "1,2,4,1"})
538 os.remove(input_path_2 / "1")
539 run(["a,b"], ["a,b"], {"1,2,3,-1"})
540 run(["a,b", "1,4"], ["a,b", "1,8"], {"1,2,8,1", "1,4,8,1", "1,4,4,1"})
541
542
543@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