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

Function test_ix

python/pathway/tests/test_common.py:2392–2418  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2390
2391
2392def test_ix():
2393 t_animals = T(
2394 """
2395 | genus | epithet
2396 1 | upupa | epops
2397 2 | acherontia | atropos
2398 3 | bubo | scandiacus
2399 4 | dynastes | hercules
2400 """
2401 )
2402 t_birds = T(
2403 """
2404 | desc | ptr
2405 1 | hoopoe | 2
2406 2 | owl | 4
2407 """
2408 ).with_columns(ptr=t_animals.pointer_from(pw.this.ptr))
2409
2410 res = t_birds.select(latin=t_animals.ix(t_birds.ptr).genus)
2411 expected = T(
2412 """
2413 | latin
2414 1 | acherontia
2415 2 | dynastes
2416 """
2417 )
2418 assert_table_equality(res, expected)
2419
2420
2421def test_ix_none():

Callers

nothing calls this directly

Calls 5

TFunction · 0.90
with_columnsMethod · 0.80
pointer_fromMethod · 0.45
selectMethod · 0.45
ixMethod · 0.45

Tested by

no test coverage detected