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

Method test_label_conflict_union

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

Source from the content-addressed store, hash-verified

7740 )
7741
7742 def test_label_conflict_union(self):
7743 t1 = Table(
7744 "t1", MetaData(), Column("a", Integer), Column("b", Integer)
7745 )
7746 t2 = Table("t2", MetaData(), Column("t1_a", Integer))
7747 union = select(t2).union(select(t2)).alias()
7748
7749 t1_alias = t1.alias()
7750 stmt = (
7751 select(t1, t1_alias)
7752 .select_from(t1.join(union, t1.c.a == union.c.t1_a))
7753 .set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL)
7754 )
7755 comp = stmt.compile()
7756 eq_(
7757 set(comp._create_result_map()),
7758 {"t1_1_b", "t1_1_a", "t1_a", "t1_b"},
7759 )
7760 is_(comp._create_result_map()["t1_a"][1][2], t1.c.a)
7761
7762 def test_insert_with_select_values(self):
7763 astring = Column("a", String)

Callers

nothing calls this directly

Calls 13

TableClass · 0.90
MetaDataClass · 0.90
ColumnClass · 0.90
selectFunction · 0.90
eq_Function · 0.90
is_Function · 0.90
_create_result_mapMethod · 0.80
aliasMethod · 0.45
unionMethod · 0.45
set_label_styleMethod · 0.45
select_fromMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected