robertwb commented on a change in pull request #16761:
URL: https://github.com/apache/beam/pull/16761#discussion_r801954077
##########
File path: sdks/python/apache_beam/typehints/trivial_inference.py
##########
@@ -227,6 +227,9 @@ def element_type(hint):
return hint.inner_type
elif isinstance(hint, typehints.TupleHint.TupleConstraint):
return typehints.Union[hint.tuple_types]
+ elif isinstance(hint,
+ typehints.UnionHint.UnionConstraint) and not
hint.union_types:
Review comment:
The empty union is a type that can never happen; we want to propagate
that to its (non-existent) "element" type.
--
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]