adjustable labels don't really work with subqueries

Issue #2396 resolved
Mike Bayer repo owner created an issue

sort of an offshoot of #2392:

from sqlalchemy import *
e = create_engine("sqlite://", echo=True, label_length=10)
m = MetaData()

table1 = Table("some_large_named_table", m,
    Column("this_is_the_primarykey_column", Integer, primary_key=True),
    Column("this_is_the_data_column", String(30))
    )

m.create_all(e)
e.execute(table1.insert(), {"this_is_the_data_column":"data"})

row = e.execute(table1.select().alias().select()).first()
assert row.this_is_the_data_column == "data"
assert row[table1.c.this_is_the_data_column](table1.c.this_is_the_data_column) == "data"
assert row['this_is_the_data_column']('this_is_the_data_column') == "data"
assert row['this_2']('this_2') == row.this_2 == "data"

the SQL compilation fails, then if you get that to work, the result targeting for that column name still fails.

Comments (4)

  1. Log in to comment