I have a few different notification tables, and I would like to perform a union across all of them to show the user all of their notifications. However, the union is not wor
I don't think this can work with a union, even supposing the query was generated as you expect. You're querying three different object types. When the ORM gets the rows back from the database, I don't see a way for it to map rows to the right class.
A UNION in this case doesn't make much sense since the third column has a different meaning in all three tables.
You should do the three queries separately, unless your three notification types inherit from a common ORM-mapped class. In that case SQLAlchemy supports querying the four types all at once, although not with a UNION.