def test_unwrap_order_by(self, expr, expected): expr = coercions.expect(roles.OrderByRole, expr) unwrapped = sql_util.unwrap_order_by(expr) for a, b in util.zip_longest(unwrapped, expected): assert a is not None and a.compare(b)
def __eq__(self, other): if self.table.name != other.name or self.table.schema != other.schema: return False for c1, c2 in util.zip_longest(self.table.c, other.c): if (c1 is None and c2 is not None) or (c2 is None and c1 is not None): return False if CompareColumn(c1) != c2: return False return True
def __eq__(self, other): r1 = (isinstance(other, schema.ForeignKeyConstraint) and self.constraint.name == other.name and (other.table.name == self.constraint.table.name) and other.table.schema == self.constraint.table.schema) if not r1: return False for c1, c2 in util.zip_longest(self.constraint.columns, other.columns): if (c1 is None and c2 is not None) or (c2 is None and c1 is not None): return False if CompareColumn(c1) != c2: return False return True
def get_expressions_or_columns(self): expr_columns = util.zip_longest(self.expressions, self.columns) return [(expr if isinstance(expr, ClauseElement) else colexpr) for expr, colexpr in expr_columns]