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

Function test_ix

python/pathway/tests/test_errors.py:637–677  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

635
636
637def 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
680def test_remove_errors():

Callers

nothing calls this directly

Calls 7

TFunction · 0.90
global_errorsFunction · 0.85
with_columnsMethod · 0.80
table_from_markdownMethod · 0.80
pointer_fromMethod · 0.45
selectMethod · 0.45
ixMethod · 0.45

Tested by

no test coverage detected