MCPcopy
hub / github.com/pathwaycom/pathway / test_left_join_this

Function test_left_join_this

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

Source from the content-addressed store, hash-verified

520
521
522def test_left_join_this():
523 t1 = T(
524 """
525 | a | b
526 1 | 11 | 111
527 2 | 12 | 112
528 3 | 13 | 113
529 4 | 14 | 114
530 """
531 )
532
533 t2 = T(
534 """
535 | a | d
536 1 | 11 | 211
537 2 | 12 | 212
538 3 | 13 | 213
539 4 | 14 | 214
540 """
541 )
542
543 expected = T(
544 """
545 a | t2_a | s
546 11 | 11 | 322
547 12 | 12 | 324
548 13 | 13 | 326
549 14 | 14 | 328
550 """
551 ).update_types(
552 t2_a=Optional[int],
553 s=Optional[int],
554 )
555
556 res = t1.join_left(t2, t1.a == t2.a).select(
557 pw.left.a,
558 t2_a=t2.a,
559 s=pw.require(pw.left.b + t2.d, t2.id),
560 )
561 assert_table_equality_wo_index(res, expected)
562
563
564# all entries match, should work as inner join

Callers

nothing calls this directly

Calls 4

TFunction · 0.90
update_typesMethod · 0.80
join_leftMethod · 0.80
selectMethod · 0.45

Tested by

no test coverage detected