Skip to content

Commit

Permalink
πŸ› (query) generate unique hash for query state
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwoerpel committed Jul 11, 2024
1 parent 18b495a commit 58a352d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ftmq/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def __bool__(self) -> bool:
"""
return bool(self.to_dict())

def __hash__(self) -> int:
# generate unique key of the current state
return hash(repr(self.to_dict()))

def _chain(self, **kwargs):
# merge current state
new_kwargs = self.__dict__.copy()
Expand Down

0 comments on commit 58a352d

Please sign in to comment.