Re: [sqlalchemy] Adding alias to join() makes a wildly different query

2019-11-29 Thread Mike Bayer
On Fri, Nov 29, 2019, at 8:02 AM, Zsolt Ero wrote: > Thanks for the detailed explanation. I think I should explain why I > run into this problem, as it's in line with emitting a warning on this > use case. > > 1. I wrote the query without any kind of alias in SQLAlchemy. > 2. Received an error

Re: [sqlalchemy] Adding alias to join() makes a wildly different query

2019-11-29 Thread Zsolt Ero
Thanks for the detailed explanation. I think I should explain why I run into this problem, as it's in line with emitting a warning on this use case. 1. I wrote the query without any kind of alias in SQLAlchemy. 2. Received an error from PostgreSQL "subquery in FROM must have an alias", so I added

Re: [sqlalchemy] Adding alias to join() makes a wildly different query

2019-11-28 Thread Mike Bayer
On Thu, Nov 28, 2019, at 4:31 PM, Zsolt Ero wrote: > I have the following query: > > min_values = ( > sa.select( > [ > table.c.region_id, > table.c.operator, > table.c.day_str, > sa.func.min(table.c.processed_time).label('min_processed_time'), > ] > ) > .group_by(table.c.region_id,