Skip to content

Commit

Permalink
SDK - Components - Make component structures hashable (#3258)
Browse files Browse the repository at this point in the history
This commit makes it possiblt to put TaskSpec or InputSpec into python set.
  • Loading branch information
Ark-kun authored Mar 11, 2020
1 parent fad7510 commit 0a9af0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sdk/python/kfp/components/modelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,7 @@ def __eq__(self, other):
return self.__class__ == other.__class__ and {k: getattr(self, k) for k in self._get_field_names()} == {k: getattr(other, k) for k in other._get_field_names()}

def __ne__(self, other):
return not self == other
return not self == other

def __hash__(self):
return hash(repr(self))

0 comments on commit 0a9af0e

Please sign in to comment.