File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 138138 " new_predicates = Predicates(self, operator='NOT')\n " ,
139139 " return new_predicates\n " ,
140140 " \n " ,
141+ " def __eq__(self, other):\n " ,
142+ " if not isinstance(other, Predicates):\n " ,
143+ " return False\n " ,
144+ " \n " ,
145+ " return (\n " ,
146+ " self.operator == other.operator and\n " ,
147+ " self.clauses == other.clauses\n " ,
148+ " )\n " ,
149+ " \n " ,
141150 " def __repr__(self):\n " ,
142151 " if self.operator:\n " ,
143152 " return f\" {self.operator}({', '.join(repr(clause) for clause in self.clauses)})\"\n " ,
Original file line number Diff line number Diff line change 3636 'timescale_vector.client.Predicates' : ('vector.html#predicates' , 'timescale_vector/client.py' ),
3737 'timescale_vector.client.Predicates.__and__' : ( 'vector.html#predicates.__and__' ,
3838 'timescale_vector/client.py' ),
39+ 'timescale_vector.client.Predicates.__eq__' : ( 'vector.html#predicates.__eq__' ,
40+ 'timescale_vector/client.py' ),
3941 'timescale_vector.client.Predicates.__init__' : ( 'vector.html#predicates.__init__' ,
4042 'timescale_vector/client.py' ),
4143 'timescale_vector.client.Predicates.__invert__' : ( 'vector.html#predicates.__invert__' ,
Original file line number Diff line number Diff line change @@ -62,6 +62,15 @@ def __invert__(self):
6262 new_predicates = Predicates (self , operator = 'NOT' )
6363 return new_predicates
6464
65+ def __eq__ (self , other ):
66+ if not isinstance (other , Predicates ):
67+ return False
68+
69+ return (
70+ self .operator == other .operator and
71+ self .clauses == other .clauses
72+ )
73+
6574 def __repr__ (self ):
6675 if self .operator :
6776 return f"{ self .operator } ({ ', ' .join (repr (clause ) for clause in self .clauses )} )"
You can’t perform that action at this time.
0 commit comments