(cast: str)
| 1367 | |
| 1368 | @pytest.mark.parametrize("cast", ["a", "b"]) |
| 1369 | def test_tuples_int_float(cast: str): |
| 1370 | table = ( |
| 1371 | T( |
| 1372 | """ |
| 1373 | a | b |
| 1374 | 1 | 1 |
| 1375 | 2 | 3 |
| 1376 | 4 | 3 |
| 1377 | """ |
| 1378 | ) |
| 1379 | .with_columns(**{cast: pw.cast(float, pw.this[cast])}) |
| 1380 | .with_columns( |
| 1381 | x=pw.make_tuple(pw.this.a, pw.this.b), y=pw.make_tuple(pw.this.b, pw.this.a) |
| 1382 | ) |
| 1383 | ) |
| 1384 | |
| 1385 | result = table.select( |
| 1386 | pw.this.a, |
| 1387 | pw.this.b, |
| 1388 | eq=pw.this.x == pw.this.y, |
| 1389 | ne=pw.this.x != pw.this.y, |
| 1390 | lt=pw.this.x < pw.this.y, |
| 1391 | le=pw.this.x <= pw.this.y, |
| 1392 | gt=pw.this.x > pw.this.y, |
| 1393 | ge=pw.this.x >= pw.this.y, |
| 1394 | ) |
| 1395 | expected = T( |
| 1396 | """ |
| 1397 | a | b | eq | ne | lt | le | gt | ge |
| 1398 | 1 | 1 | True | False | False | True | False | True |
| 1399 | 2 | 3 | False | True | True | True | False | False |
| 1400 | 4 | 3 | False | True | False | False | True | True |
| 1401 | """ |
| 1402 | ).with_columns(**{cast: pw.cast(float, pw.this[cast])}) |
| 1403 | assert_table_equality(result, expected) |
| 1404 | |
| 1405 | |
| 1406 | def test_tuples_none(): |
nothing calls this directly
no test coverage detected