test #6520
(self)
| 650 | ) |
| 651 | |
| 652 | def test_pickle_within_group(self): |
| 653 | """test #6520""" |
| 654 | |
| 655 | # TODO: the test/sql package lacks a comprehensive pickling |
| 656 | # test suite even though there are __reduce__ methods in several |
| 657 | # places in sql/elements.py. likely as part of |
| 658 | # test/sql/test_compare.py might be a place this can happen but |
| 659 | # this still relies upon a strategy for table metadata as we have |
| 660 | # in serializer. |
| 661 | |
| 662 | f1 = func.percentile_cont(literal(1)).within_group(column("q")) |
| 663 | |
| 664 | self.assert_compile( |
| 665 | pickle.loads(pickle.dumps(f1)), |
| 666 | "percentile_cont(:param_1) WITHIN GROUP (ORDER BY q)", |
| 667 | ) |
| 668 | |
| 669 | f1 = func.percentile_cont(literal(1)).within_group( |
| 670 | column("q"), column("p").desc() |
| 671 | ) |
| 672 | self.assert_compile( |
| 673 | pickle.loads(pickle.dumps(f1)), |
| 674 | "percentile_cont(:param_1) WITHIN GROUP (ORDER BY q, p DESC)", |
| 675 | ) |
| 676 | |
| 677 | def test_functions_with_cols(self): |
| 678 | users = table( |
nothing calls this directly
no test coverage detected