robertwb commented on code in PR #34414:
URL: https://github.com/apache/beam/pull/34414#discussion_r2012802451


##########
sdks/python/apache_beam/typehints/typehints.py:
##########
@@ -505,7 +505,11 @@ class UnionHint(CompositeTypeHint):
   """
   class UnionConstraint(TypeConstraint):
     def __init__(self, union_types):
-      self.union_types = set(normalize(t) for t in union_types)
+      # Use a list instead of a set to make the pickle serialization
+      # deterministic.
+      self.union_types = list(set(normalize(t) for t in union_types))
+      # Sorting the type name strings simplifies unit tests.
+      self.union_types.sort(key=repr)
 
     def __eq__(self, other):

Review Comment:
   This needs to be updated as well in case repr of one of the inner types is 
not sufficient for equality testing. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to