MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_pickle_within_group

Method test_pickle_within_group

test/sql/test_functions.py:595–618  ·  view source on GitHub ↗

test #6520

(self)

Source from the content-addressed store, hash-verified

593 )
594
595 def test_pickle_within_group(self):
596 """test #6520"""
597
598 # TODO: the test/sql package lacks a comprehensive pickling
599 # test suite even though there are __reduce__ methods in several
600 # places in sql/elements.py. likely as part of
601 # test/sql/test_compare.py might be a place this can happen but
602 # this still relies upon a strategy for table metadata as we have
603 # in serializer.
604
605 f1 = func.percentile_cont(literal(1)).within_group()
606
607 self.assert_compile(
608 pickle.loads(pickle.dumps(f1)),
609 "percentile_cont(:param_1) WITHIN GROUP (ORDER BY )",
610 )
611
612 f1 = func.percentile_cont(literal(1)).within_group(
613 column("q"), column("p").desc()
614 )
615 self.assert_compile(
616 pickle.loads(pickle.dumps(f1)),
617 "percentile_cont(:param_1) WITHIN GROUP (ORDER BY q, p DESC)",
618 )
619
620 def test_functions_with_cols(self):
621 users = table(

Callers

nothing calls this directly

Calls 8

literalFunction · 0.90
columnFunction · 0.90
percentile_contMethod · 0.80
assert_compileMethod · 0.80
within_groupMethod · 0.45
loadsMethod · 0.45
dumpsMethod · 0.45
descMethod · 0.45

Tested by

no test coverage detected