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

Function test_nested_tuples

python/pathway/tests/test_operators.py:1272–1303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1270
1271
1272def test_nested_tuples():
1273 table = T(
1274 """
1275 a | b
1276 1 | 1
1277 2 | 3
1278 4 | 3
1279 """
1280 ).with_columns(
1281 x=pw.make_tuple("a", pw.make_tuple(pw.this.a, pw.this.b)),
1282 y=pw.make_tuple("a", pw.make_tuple(pw.this.b, pw.this.a)),
1283 )
1284
1285 result = table.select(
1286 pw.this.a,
1287 pw.this.b,
1288 eq=pw.this.x == pw.this.y,
1289 ne=pw.this.x != pw.this.y,
1290 lt=pw.this.x < pw.this.y,
1291 le=pw.this.x <= pw.this.y,
1292 gt=pw.this.x > pw.this.y,
1293 ge=pw.this.x >= pw.this.y,
1294 )
1295 expected = T(
1296 """
1297 a | b | eq | ne | lt | le | gt | ge
1298 1 | 1 | True | False | False | True | False | True
1299 2 | 3 | False | True | True | True | False | False
1300 4 | 3 | False | True | False | False | True | True
1301 """
1302 )
1303 assert_table_equality(result, expected)
1304
1305
1306@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

TFunction · 0.90
with_columnsMethod · 0.80
selectMethod · 0.45

Tested by

no test coverage detected