def test_leaves(): t = TableSymbol('t', '{id: int32, name: string}') v = TableSymbol('v', '{id: int32, city: string}') x = ScalarSymbol('x', 'int32') assert t.leaves() == [t] assert t.id.leaves() == [t] assert by(t.name, t.id.nunique()).leaves() == [t] assert join(t, v).leaves() == [t, v] assert join(v, t).leaves() == [v, t] assert (x + 1).leaves() == [x]