Re: [sqlalchemy] struggling with postgres json related query using sqlalchemy -- sqlalchemy bug or issue with query?

2017-03-16 Thread mike bayer
I put up https://bitbucket.org/zzzeek/sqlalchemy/issues/3939/alias-as-column-expr-needs-tweak-to with the specific Alias issue but if you can add context what the end goal is that would be helpful, thanks. On 03/16/2017 09:56 AM, Lukas Siemon wrote: Makes perfect sense. I'll post a

Re: [sqlalchemy] struggling with postgres json related query using sqlalchemy -- sqlalchemy bug or issue with query?

2017-03-16 Thread Lukas Siemon
Makes perfect sense. I'll post a complete bug report in the tracker later today (it's early morning here atm). -- 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

Re: [sqlalchemy] struggling with postgres json related query using sqlalchemy -- sqlalchemy bug or issue with query?

2017-03-16 Thread mike bayer
see here's what I don't get, hence why complete test case v helpful: if i fix self_group() (which yes is a bug, I can fix that), this case still fails, because the alias() has no "type": from sqlalchemy import * t = table('t', column('x')) expr = func.array_agg(select([t]).alias()) stmt =

Re: [sqlalchemy] struggling with postgres json related query using sqlalchemy -- sqlalchemy bug or issue with query?

2017-03-16 Thread mike bayer
func.XYZ()? I can look into that. ideally you'd be doing func.XYZ(selectable.as_scalar()), but letting alias work there is fine. On 03/15/2017 08:31 PM, Lukas Siemon wrote: Monkey patching seems to do the trick: # Patch alias self_group kwargs def patched_alias_self_group(self,

Re: [sqlalchemy] struggling with postgres json related query using sqlalchemy -- sqlalchemy bug or issue with query?

2017-03-16 Thread mike bayer
no idea, may I have a complete test case please? On 03/15/2017 07:53 PM, Lukas Siemon wrote: Was the underlying issue ever resolved? Running into the same error here, but my query generation is automatic, so taking it apart will take a little longer... On Thursday, 17 November 2016 07:57:56