def METHOD_NAME(alltypes, snapshot):
    t = alltypes
    w = window(order_by=t.f)
    expr = (t.f - t.f.lag()).lag().over(w).name("foo")
    result = t.select(expr)
    assert_sql_equal(result, snapshot)