modify RowEvent hash key

conditions can not be as the hash key, some columns type are list or dict which
can't be hash

Change-Id: Ib9cdf6ab6cabd60b3d42bd4acde6daae0831b96c
This commit is contained in:
Frank Wang 2019-02-13 10:10:32 +08:00
parent bc06517ba3
commit 5e141174f1
1 changed files with 3 additions and 2 deletions

View File

@ -38,14 +38,15 @@ class RowEvent(object):
@property
def key(self):
return (self.__class__, self.table, self.events, self.conditions)
return (self.__class__, self.table, tuple(self.events))
def __hash__(self):
return hash(self.key)
def __eq__(self, other):
try:
return self.key == other.key
return (self.key == other.key and
self.conditions == other.conditions)
except AttributeError:
return False