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

Method test_label_plus_element

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

Source from the content-addressed store, hash-verified

7719 )
7720
7721 def test_label_plus_element(self):
7722 t = Table("t", MetaData(), Column("a", Integer))
7723 l1 = t.c.a.label("bar")
7724 tc = type_coerce(t.c.a + "str", String)
7725 stmt = select(t.c.a, l1, tc)
7726 comp = stmt.compile()
7727 tc_anon_label = comp._create_result_map()["anon_1"][1][0]
7728 eq_(
7729 comp._create_result_map(),
7730 {
7731 "a": ("a", (t.c.a, "a", "a", "t_a"), t.c.a.type, 0),
7732 "bar": ("bar", (l1, "bar"), l1.type, 1),
7733 "anon_1": (
7734 tc._anon_name_label,
7735 (tc_anon_label, "anon_1", tc, "_no_label"),
7736 tc.type,
7737 2,
7738 ),
7739 },
7740 )
7741
7742 def test_label_conflict_union(self):
7743 t1 = Table(

Callers

nothing calls this directly

Calls 9

TableClass · 0.90
MetaDataClass · 0.90
ColumnClass · 0.90
type_coerceFunction · 0.90
selectFunction · 0.90
eq_Function · 0.90
_create_result_mapMethod · 0.80
labelMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected