(self)
| 3518 | ) |
| 3519 | |
| 3520 | def test_over_within_group(self): |
| 3521 | from sqlalchemy import within_group |
| 3522 | |
| 3523 | stmt = select( |
| 3524 | table1.c.myid, |
| 3525 | within_group(func.percentile_cont(0.5), table1.c.name.desc()).over( |
| 3526 | range_=(1, 2), |
| 3527 | partition_by=table1.c.name, |
| 3528 | order_by=table1.c.myid, |
| 3529 | ), |
| 3530 | ) |
| 3531 | eq_ignore_whitespace( |
| 3532 | str(stmt), |
| 3533 | "SELECT mytable.myid, percentile_cont(:percentile_cont_1) " |
| 3534 | "WITHIN GROUP (ORDER BY mytable.name DESC) " |
| 3535 | "OVER (PARTITION BY mytable.name ORDER BY mytable.myid " |
| 3536 | "RANGE BETWEEN :param_1 FOLLOWING AND :param_2 FOLLOWING) " |
| 3537 | "AS anon_1 FROM mytable", |
| 3538 | ) |
| 3539 | |
| 3540 | stmt = select( |
| 3541 | table1.c.myid, |
| 3542 | within_group(func.percentile_cont(0.5), table1.c.name.desc()).over( |
| 3543 | rows=(1, 2), |
| 3544 | partition_by=table1.c.name, |
| 3545 | order_by=table1.c.myid, |
| 3546 | ), |
| 3547 | ) |
| 3548 | eq_ignore_whitespace( |
| 3549 | str(stmt), |
| 3550 | "SELECT mytable.myid, percentile_cont(:percentile_cont_1) " |
| 3551 | "WITHIN GROUP (ORDER BY mytable.name DESC) " |
| 3552 | "OVER (PARTITION BY mytable.name ORDER BY mytable.myid " |
| 3553 | "ROWS BETWEEN :param_1 FOLLOWING AND :param_2 FOLLOWING) " |
| 3554 | "AS anon_1 FROM mytable", |
| 3555 | ) |
| 3556 | |
| 3557 | def test_date_between(self): |
| 3558 | import datetime |
nothing calls this directly
no test coverage detected