filter by row_number in sqlalchemy
<p>how can I filter the row_number ==1 in the following query:</p>

<pre><code>query = session.query(Foo, func.row_number().over(
        partition_by=Foo.foo_field, order_by=desc(Foo.foo_date_time)).label("row_number"))

    query = query.filter(Foo.time_key &lt;= time_key)
    # query = query.filter(row_number == 1)
    result = query.all()
</code></pre>