def equals(self, other, cache=None): if cache is None: cache = {} if (self, other) in cache: return cache[(self, other)] if id(self) == id(other): cache[(self, other)] = True return True if not isinstance(other, Window): cache[(self, other)] = False return False if (len(self._group_by) != len(other._group_by) or not ir.all_equal( self._group_by, other._group_by, cache=cache)): cache[(self, other)] = False return False if (len(self._order_by) != len(other._order_by) or not ir.all_equal( self._order_by, other._order_by, cache=cache)): cache[(self, other)] = False return False equal = (self.preceding == other.preceding and self.following == other.following) cache[(self, other)] = equal return equal
def equals(self, other): if not isinstance(other, Window): return False if (len(self._group_by) != len(other._group_by) or not ir.all_equal(self._group_by, other._group_by)): return False if (len(self._order_by) != len(other._order_by) or not ir.all_equal(self._order_by, other._order_by)): return False return (self.preceding == other.preceding and self.following == other.following)