Support generic types for union and union_all
Support generic types for compound selects (:func:`_sql.union`,
:func:`_sql.union_all`, :meth:`_sql.Select.union`,
:meth:`_sql.Select.union_all`, etc) returning the type of the first select.
Fixes: #11922
Closes: #12320
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12320
Pull-request-sha:
f914a19f7201cec292056e900436d8c8431b9f87
Change-Id: I4fffa5d3fe93dd3a293b078360e326fea4207c5d
(cherry picked from commit
fc44b5078b74081b0df94cca9d21b89ed578caf3)