

def __sql__(self):
    over_clauses = []
    if self.partition_by:
        over_clauses.append(Clause(SQL('PARTITION BY'), CommaClause(*self.partition_by)))
    if self.order_by:
        over_clauses.append(Clause(SQL('ORDER BY'), CommaClause(*self.order_by)))
    return EnclosedClause(Clause(*over_clauses))

dataset/ETHPy150Open coleifer/peewee/peewee.py Window.__sql__/original