()
| 520 | |
| 521 | |
| 522 | def 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 |
nothing calls this directly
no test coverage detected