()
| 1237 | |
| 1238 | |
| 1239 | def 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 | |
| 1272 | def test_nested_tuples(): |
nothing calls this directly
no test coverage detected