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

Function test_tuples

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

Source from the content-addressed store, hash-verified

1237
1238
1239def test_tuples():
1240 table = T(
1241 """
1242 a | b
1243 1 | 1
1244 2 | 3
1245 4 | 3
1246 """
1247 ).with_columns(
1248 x=pw.make_tuple(pw.this.a, pw.this.b), y=pw.make_tuple(pw.this.b, pw.this.a)
1249 )
1250
1251 result = table.select(
1252 pw.this.a,
1253 pw.this.b,
1254 eq=pw.this.x == pw.this.y,
1255 ne=pw.this.x != pw.this.y,
1256 lt=pw.this.x < pw.this.y,
1257 le=pw.this.x <= pw.this.y,
1258 gt=pw.this.x > pw.this.y,
1259 ge=pw.this.x >= pw.this.y,
1260 )
1261 expected = T(
1262 """
1263 a | b | eq | ne | lt | le | gt | ge
1264 1 | 1 | True | False | False | True | False | True
1265 2 | 3 | False | True | True | True | False | False
1266 4 | 3 | False | True | False | False | True | True
1267 """
1268 )
1269 assert_table_equality(result, expected)
1270
1271
1272def test_nested_tuples():

Callers

nothing calls this directly

Calls 3

TFunction · 0.90
with_columnsMethod · 0.80
selectMethod · 0.45

Tested by

no test coverage detected