From ab23c9147ad48c533196a7be5d75a0bec15329c7 Mon Sep 17 00:00:00 2001 From: tvalentyn Date: Fri, 18 May 2018 16:57:55 -0700 Subject: [PATCH] Make hash function in Coder base class more conservative. [BEAM-5390] --- sdks/python/apache_beam/coders/coders.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdks/python/apache_beam/coders/coders.py b/sdks/python/apache_beam/coders/coders.py index b6aa40d6c82f..e9ba160c835b 100644 --- a/sdks/python/apache_beam/coders/coders.py +++ b/sdks/python/apache_beam/coders/coders.py @@ -220,11 +220,10 @@ def __repr__(self): def __eq__(self, other): return (self.__class__ == other.__class__ and self._dict_without_impl() == other._dict_without_impl()) + # pylint: enable=protected-access def __hash__(self): - return hash((self.__class__,) + - tuple(sorted(self._dict_without_impl().items()))) - # pylint: enable=protected-access + return hash(type(self)) _known_urns = {}