MCPcopy
hub / github.com/pathwaycom/pathway / test_right_join_03

Function test_right_join_03

python/pathway/tests/test_joins.py:311–348  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

309# as opposed to test 2, column t2_C2 can be computed out of columns of t2
310# as such, it should be filled, even if there was no match
311def test_right_join_03():
312 t1 = T(
313 """
314 | a | b
315 1 | 11 | 111
316 2 | 12 | 112
317 3 | 13 | 113
318 4 | 13 | 114
319 """
320 )
321
322 t2 = T(
323 """
324 | c | d
325 1 | 11 | 211
326 2 | 12 | 212
327 3 | 13 | 213
328 4 | 14 | 214
329 """
330 )
331
332 expected = T(
333 """
334 a | t2_c2 | s
335 11 | 121 | 322
336 12 | 144 | 324
337 13 | 169 | 326
338 13 | 169 | 327
339 | 196 |
340 """
341 )
342
343 res = t1.join_right(t2, t1.a == t2.c).select(
344 t1.a,
345 t2_c2=t2.c * t2.c,
346 s=pw.require(t1.b + t2.d, t1.id),
347 )
348 assert_table_equality_wo_index(res, expected)
349
350
351# corner case test: if no column is computable with only outer values,

Callers

nothing calls this directly

Calls 3

TFunction · 0.90
join_rightMethod · 0.80
selectMethod · 0.45

Tested by

no test coverage detected