MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_within_group

Method test_within_group

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

Source from the content-addressed store, hash-verified

6357 eq_(str(Grouping(Widget())), "(widget ?)")
6358
6359 def test_within_group(self):
6360 # stringify of these was supported anyway by defaultdialect.
6361 from sqlalchemy import within_group
6362
6363 stmt = select(
6364 table1.c.myid,
6365 within_group(func.percentile_cont(0.5), table1.c.name.desc()),
6366 )
6367 eq_ignore_whitespace(
6368 str(stmt),
6369 "SELECT mytable.myid, percentile_cont(:percentile_cont_2) "
6370 "WITHIN GROUP (ORDER BY mytable.name DESC) AS percentile_cont_1 "
6371 "FROM mytable",
6372 )
6373
6374 @testing.combinations(
6375 ("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