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

Function test_ix_optional

python/pathway/tests/test_utils.py:25–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def test_ix_optional():
26 t_animals = T(
27 """
28 | genus | epithet
29 1 | upupa | epops
30 2 | acherontia | atropos
31 3 | bubo | scandiacus
32 """
33 )
34 t_indexer = T(
35 """
36 | indexer
37 0 | 3
38 1 | 1
39 2 | 0
40 3 | 4
41 4 | 2
42 """,
43 ).with_columns(indexer=pw.this.pointer_from(pw.this.indexer))
44 ret = t_animals.ix(t_indexer.indexer, allow_misses=True).filter(
45 pw.this.genus.is_not_none()
46 )[["genus"]]
47 expected = T(
48 """
49 | genus
50 0 | bubo
51 1 | upupa
52 4 | acherontia
53 """
54 )
55 assert_table_equality(ret, expected)
56
57
58def test_unpack_col():

Callers

nothing calls this directly

Calls 6

TFunction · 0.90
with_columnsMethod · 0.80
is_not_noneMethod · 0.80
pointer_fromMethod · 0.45
filterMethod · 0.45
ixMethod · 0.45

Tested by

no test coverage detected