MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_within_group_w_over

Method test_within_group_w_over

test/sql/test_functions.py:1022–1036  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1020 )
1021
1022 def test_within_group_w_over(self):
1023 stmt = select(
1024 table1.c.myid,
1025 func.percentile_cont(0.5)
1026 .within_group(table1.c.name.desc())
1027 .over(partition_by=table1.c.description),
1028 )
1029 self.assert_compile(
1030 stmt,
1031 "SELECT mytable.myid, percentile_cont(:percentile_cont_1) "
1032 "WITHIN GROUP (ORDER BY mytable.name DESC) "
1033 "OVER (PARTITION BY mytable.description) AS anon_1 "
1034 "FROM mytable",
1035 {"percentile_cont_1": 0.5},
1036 )
1037
1038 def test_within_group_filter(self):
1039 stmt = select(

Callers

nothing calls this directly

Calls 6

selectFunction · 0.90
percentile_contMethod · 0.80
assert_compileMethod · 0.80
overMethod · 0.45
within_groupMethod · 0.45
descMethod · 0.45

Tested by

no test coverage detected