Skip to content

Commit 8d62962

Browse files
committed
Minor fixes
1 parent 49a399a commit 8d62962

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

nbs/00_vector.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@
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",

timescale_vector/_modidx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
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__',

timescale_vector/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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)})"

0 commit comments

Comments
 (0)