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

Function test_outer_join_01

python/pathway/tests/test_joins.py:565–605  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

563
564# all entries match, should work as inner join
565def test_outer_join_01():
566 t1 = T(
567 """
568 | a | b
569 1 | 11 | 111
570 2 | 12 | 112
571 3 | 13 | 113
572 4 | 14 | 114
573 """
574 )
575
576 t2 = T(
577 """
578 | a | d
579 1 | 11 | 211
580 2 | 12 | 212
581 3 | 13 | 213
582 4 | 14 | 214
583 """
584 )
585
586 expected = T(
587 """
588 a | t2_a | s
589 11 | 11 | 322
590 12 | 12 | 324
591 13 | 13 | 326
592 14 | 14 | 328
593 """
594 ).update_types(
595 a=Optional[int],
596 t2_a=Optional[int],
597 s=Optional[int],
598 )
599
600 res = t1.join_outer(t2, t1.a == t2.a).select(
601 t1.a,
602 t2_a=t2.a,
603 s=pw.require(t1.b + t2.d, t1.id, t2.id),
604 )
605 assert_table_equality_wo_index(res, expected)
606
607
608# 14 should not match, unmatched entry form the right table

Callers

nothing calls this directly

Calls 4

TFunction · 0.90
update_typesMethod · 0.80
join_outerMethod · 0.80
selectMethod · 0.45

Tested by

no test coverage detected