MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_distinct_function_6008

Method test_distinct_function_6008

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

Source from the content-addressed store, hash-verified

1973
1974 @testing.emits_warning("Column-expression-level unary distinct")
1975 def test_distinct_function_6008(self):
1976 # the bug fixed here as part of #6008 is the same bug that's
1977 # in 1.3 as well, producing
1978 # "SELECT anon_2.anon_1 FROM (SELECT distinct mytable.myid
1979 # FROM mytable) AS anon_2"
1980 self.assert_compile(
1981 select(select(distinct(table1.c.myid)).subquery()),
1982 "SELECT anon_2.anon_1 FROM (SELECT "
1983 "DISTINCT mytable.myid AS anon_1 FROM mytable) AS anon_2",
1984 )
1985
1986 self.assert_compile(
1987 select(select(table1.c.myid.distinct()).subquery()),
1988 "SELECT anon_2.anon_1 FROM (SELECT "
1989 "DISTINCT mytable.myid AS anon_1 FROM mytable) AS anon_2",
1990 )
1991
1992 def test_distinct_function(self):
1993 self.assert_compile(

Callers

nothing calls this directly

Calls 5

selectFunction · 0.90
distinctFunction · 0.90
assert_compileMethod · 0.80
subqueryMethod · 0.45
distinctMethod · 0.45

Tested by

no test coverage detected