Hello List,
the problem I am facing is that _deep_deannotate, which is used in ColumnProperty.__init__, breaks the FROM clause of my select() object if this select() has a JOIN (either left or right, doesn't matter) as from_obj in it, _where the initial table is aliased_.
To illustrate I'll append my testcase. I traced it down to Select._copy_internals(), line 4907 in sqlalchemy.sql.expression, where the call to s._from_obj.union(s._froms) will happily add an the initial table _a second time_ to the FROM clause, (it is already part of the join object) resulting in an error from the database because the alias is duplicated in the generated SQL.
Taking any hints on how to fix this. :)
Reproduced in 0.7.6
thanks,
Christoph