In SQLA 1.3.x, I used to follow this pattern to construct a query:

```
def load_something(... sort=False):
   qry = select(columns=..., from_obj=...)
   if sort:
     qry = qry.order_by(desc(qry.c.created_on))
   if ...
     qry = qry...
```

but in 1.4.0 and 1.4.37 (I guess the versions in between as well), this 
doesn't work any more.

The error message that I now get relates to aliases being created which 
don't actually exist:

sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) missing 
FROM-clause entry for table "anon_2"
LINE 4: WHERE task.type = 'xyz' ORDER BY anon_2.created_on DESC, ...

I've been using this pattern quite a lot. Is there a way to reinstate this 
functionality or monkey patch my version until I changed the code?

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/f97ab789-dc20-4ebb-b639-a7019d206a84n%40googlegroups.com.

Reply via email to