With Core SQLAlchemy 1.4/2.0:
from sqlalchemy import text, select, column
sql = 'SELECT foo FROM bar'
sql = text(sql)
sql = sql.columns(column('foo')) # This let's it be used as a subquery
sel = select(sql.selected_columns.foo).select_from(sql.subquery())
joined = sel.outerjoin(baz_t, baz_t.foo==sel.c.foo)
final = select(sel.c.foo).select_from(joined)
With Core SQLAlchemy < 1.4:
sql = 'SELECT foo FROM bar'
sql = text(sql)
sql = sql.columns() # This let's it be used as a subquery
sel = select(['foo']).select_from(sql)
# I needed this for a complex query or else columns would be ambiguous
sel = sel.alias('sel')
joined = sel.outerjoin(baz_t, baz_t.foo==sel.c.foo)
final = select([sel.c.foo]).select_from(joined)
Note that the columns() is necessary, and the alias() is helpful if the query is complex.
The following text documentation is helpful.