SqlAlchemy uses the tables that columns are associated to, to decide what to include in the FROM clause. Because sql_raw does not have a table associated with it--having it as the sole column causes the FROM clause to be omitted.
We could pretty easily, associate the current table/subquery to the clause, but I wonder if we should also add an argument to sql_raw to optionally disable this behavior.
Note also that sql_raw is literally sqlalchemy.sql.elements.literal_column, so a user could add the table themselves, etc..
SqlAlchemy uses the tables that columns are associated to, to decide what to include in the FROM clause. Because sql_raw does not have a table associated with it--having it as the sole column causes the FROM clause to be omitted.
We could pretty easily, associate the current table/subquery to the clause, but I wonder if we should also add an argument to sql_raw to optionally disable this behavior.
Note also that sql_raw is literally sqlalchemy.sql.elements.literal_column, so a user could add the table themselves, etc..