MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_in_cte_implicit

Method test_in_cte_implicit

test/sql/test_operators.py:4947–4962  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4945 )
4946
4947 def test_in_cte_implicit(self):
4948 t = table("t", column("x"))
4949
4950 stmt = select(t.c.x).cte()
4951
4952 with expect_warnings(
4953 r"Coercing CTE object into a select\(\) for use in "
4954 r"IN\(\); please pass a select\(\) construct explicitly",
4955 ):
4956 s2 = select(column("q").in_(stmt))
4957
4958 self.assert_compile(
4959 s2,
4960 "WITH anon_2 AS (SELECT t.x AS x FROM t) "
4961 "SELECT q IN (SELECT anon_2.x FROM anon_2) AS anon_1",
4962 )
4963
4964 def test_in_cte_explicit(self):
4965 t = table("t", column("x"))

Callers

nothing calls this directly

Calls 7

tableFunction · 0.90
columnFunction · 0.90
expect_warningsFunction · 0.90
selectFunction · 0.85
assert_compileMethod · 0.80
cteMethod · 0.45
in_Method · 0.45

Tested by

no test coverage detected