[Sqlalchemy-tickets] Issue #3933: select_entity_from not replacing entity & aliased not adapting on
Brought to you by:
zzzeek
From: Eoghan M. <iss...@bi...> - 2017-03-11 00:45:47
|
New issue 3933: select_entity_from not replacing entity & aliased not adapting on names https://bitbucket.org/zzzeek/sqlalchemy/issues/3933/select_entity_from-not-replacing-entity Eoghan Murray: In the [select_entity_from docs](http://docs.sqlalchemy.org/en/latest/orm/query.html?highlight=select_entity_from#sqlalchemy.orm.query.Query.select_entity_from) it reads: "This method is similar to the Query.select_from() method, in that it sets the FROM clause of the query. However, where Query.select_from() only affects what is placed in the FROM, this method also applies the given selectable to replace the FROM which the selected entities would normally select from." As you can hopefully see from the attached test case, 1. aliased fails to recognize that it can adapt an autoloaded view to an existing entity, even when `adapt_on_names` is specified 2. select_entity_from doesn't throw an exception when it can't replace the main entity but instead adds a FROM. This is undesired from what I understand is intended. |