title: How to union two subqueries in SQLAlchemy and postgresql
body: <p>Raw SQL desired:</p>
  
  <pre><code>SELECT
      id
  FROM
     (SELECT some_table.id FROM some_table WHERE some_table.some_field IS NULL) AS subq1
     UNION
     (SELECT some_table.id WHERE some_table.some_field IS NOT NULL)
  LIMIT 10;
  </code></pre>
  
  <p>Here is the python code:</p>
  
  <pre><code>import sqlalchemy
  
  SOME_TABLE = sqlalchemy.Table(
   'some_table',
   sqlalchemy.MetaData(),
   sqlalchemy.Column('id', sqlalchemy.Integer, primary_key=True),
   sqlalchemy.Column('some_field', sqlalchemy.Text))
  
  stmt_1 = sqlalchemy.sql.select(SOME_TABLE.columns).where(SOME_TABLE.columns.some_field != None)
  stmt_2 = sqlalchemy.sql.select(SOME_TABLE.columns).where(SOME_TABLE.columns.some_field == None)
  
  # This gets a programming error.
  stmt_1.union(stmt_2).limit(10);
  </code></pre>
  
  <p>Here is the outputted SQL (with parameters swapped in) that gets this error:
  <strong>ERROR:  syntax error at or near "UNION":</strong></p>
  
  <pre><code>SELECT some_table.id, some_table.some_field
  FROM some_table
  WHERE some_table.some_field IS NOT NULL
   LIMIT 10 UNION SELECT some_table.id, some_table.some_field
  FROM some_table
  WHERE some_table.some_field IS NULL
   LIMIT 10
   LIMIT 10
  </code></pre>
  
  <p>How can I alias the subqueries?</p>