johnjcasey commented on a change in pull request #16923:
URL: https://github.com/apache/beam/pull/16923#discussion_r822735954



##########
File path: sdks/python/apache_beam/coders/typecoders.py
##########
@@ -138,6 +137,10 @@ def get_coder(self, typehint):
         return coders.IterableCoder.from_type_hint(typehint, self)
       elif isinstance(typehint, typehints.ListConstraint):
         return coders.ListCoder.from_type_hint(typehint, self)
+      elif (isinstance(typehint, typehints.UnionConstraint) and
+            typehint.contains_type(type(None) and
+                                   len(list(typehint._inner_types())) == 2)):
+        return coders.NullableCoder.from_type_hint(typehint, self)

Review comment:
       No, I thought it made more sense to use the full typehint, to try and 
match the existing coder.from_type_hint pattern




-- 
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