def METHOD_NAME(alltypes, snapshot):
    t = alltypes
    w = window(order_by=ibis.desc(t.f))
    proj = t[t.f, ibis.row_number().over(w).name("revrank")]
    assert_sql_equal(proj, snapshot, "out1.sql")
    expr = t.group_by("g").order_by(ibis.desc(t.f))[t.d.lag().name("foo"), t.a.max()]
    assert_sql_equal(expr, snapshot, "out2.sql")