- edited description
can't print a select statement that contains aggregate_order_by
during debugging, I tried to print a select statement that is using the aggregate_order_by function (postgresql), but that raises a rendering exception:
sqlalchemy.exc.UnsupportedCompilationError: Compiler <sqlalchemy.sql.compiler.StrSQLCompiler object at 0x7fec0069fda0> can't render element of type <class 'sqlalchemy.dialects.postgresql.ext.aggregate_order_by'>
This is happening in the context of a subquery containing a json_agg: func.json_agg(aggregate_order_by(my_subquery.c.item, my_subquery.c.columnX)).label('x')
Comments (5)
-
reporter -
reporter - edited description
-
reporter - edited description
-
repo owner - changed status to closed
not all dialect-specific constructs include a default compilation; ON CONFLICT will also not render as well as a bunch of other things across dialects. See the instructions at https://docs.sqlalchemy.org/en/latest/faq/sqlexpressions.html#how-do-i-render-sql-expressions-as-strings-possibly-with-bound-parameters-inlined for printing dialect-specific SQL constructs.
-
reporter I see! Thanks, Mike. I hope you are doing well.
- Log in to comment