[Sqlalchemy-tickets] [sqlalchemy] #2813: Buglette with annotated join condition
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2013-08-27 00:51:40
|
#2813: Buglette with annotated join condition ---------------------+----------------------------------------- Reporter: dairiki | Owner: zzzeek Type: defect | Status: new Priority: lowest | Milestone: 0.8.xx Component: orm | Severity: no triage selected yet Keywords: | Progress State: awaiting triage ---------------------+----------------------------------------- Here's the crux (full test script attached below). I have an explicitly annotated join condition. One of the columns in the ON clause is not having its name qualified with its table. {{{ class TableTwo(Base): ... x = Column(Integer) r = relationship(TableOne, primaryjoin=remote(TableOne.x)==foreign(x)) print sess.query(TableTwo).join('r') >>> SELECT ... FROM Two JOIN One ON One.x = x }}} Executing this query results in an "ambiguous column name" operational error. This behavior seems to pertain to 0.8.2, rel_0_8 and master (atm). Specifying the join condition as a string (so that it get evalled later) works correctly. Using the {{{foreign_keys}}} arg instead of the {{{foreign()}}} annotation work correctly. -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2813> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |