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

Method test_within_group

test/sql/test_compiler.py:6154–6166  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6152 eq_(str(Grouping(Widget())), "(widget ?)")
6153
6154 def test_within_group(self):
6155 # stringify of these was supported anyway by defaultdialect.
6156 from sqlalchemy import within_group
6157
6158 stmt = select(
6159 table1.c.myid,
6160 within_group(func.percentile_cont(0.5), table1.c.name.desc()),
6161 )
6162 eq_ignore_whitespace(
6163 str(stmt),
6164 "SELECT mytable.myid, percentile_cont(:percentile_cont_1) "
6165 "WITHIN GROUP (ORDER BY mytable.name DESC) AS anon_1 FROM mytable",
6166 )
6167
6168 @testing.combinations(
6169 ("datetime", datetime.datetime.now()),

Callers

nothing calls this directly

Calls 5

selectFunction · 0.90
within_groupFunction · 0.90
eq_ignore_whitespaceFunction · 0.90
percentile_contMethod · 0.80
descMethod · 0.45

Tested by

no test coverage detected