()
| 635 | |
| 636 | |
| 637 | def test_ix(): |
| 638 | t1 = pw.debug.table_from_markdown( |
| 639 | """ |
| 640 | | a |
| 641 | 1 | 1 |
| 642 | 2 | 3 |
| 643 | 3 | 2 |
| 644 | 4 | 2 |
| 645 | """ |
| 646 | ).with_columns(ap=pw.this.pointer_from(pw.this.a)) |
| 647 | |
| 648 | t2 = pw.debug.table_from_markdown( |
| 649 | """ |
| 650 | | c |
| 651 | 1 | 10 |
| 652 | 2 | 13 |
| 653 | """ |
| 654 | ) |
| 655 | res = t1.select(pw.this.a, c=t2.ix(pw.this.ap).c) |
| 656 | res = res.select(pw.this.a, c=pw.fill_error(res.c, -1)) |
| 657 | expected = pw.debug.table_from_markdown( |
| 658 | """ |
| 659 | | a | c |
| 660 | 1 | 1 | 10 |
| 661 | 2 | 3 | -1 |
| 662 | 3 | 2 | 13 |
| 663 | 5 | 2 | 13 |
| 664 | """ |
| 665 | ) |
| 666 | expected_errors = T( |
| 667 | """ |
| 668 | message | line |
| 669 | key missing in output table: ^Z3QWT294JQSHPSR8KTPG9ECE4W | res = t1.select(pw.this.a, c=t2.ix(pw.this.ap).c) |
| 670 | """, |
| 671 | split_on_whitespace=False, |
| 672 | ) |
| 673 | assert_table_equality_wo_index( |
| 674 | (res, global_errors()), |
| 675 | (expected, expected_errors), |
| 676 | terminate_on_error=False, |
| 677 | ) |
| 678 | |
| 679 | |
| 680 | def test_remove_errors(): |
nothing calls this directly
no test coverage detected